ReBeT applied a to a Turtlebot
- Create a workspace folder, preferrably in your home folder:
mkdir -p ~/rebet_ws/src- Clone this repository. For example:
cd ~/rebet_ws/src
git clone https://github.com/andrulonis/rebet_frog.gitKeep in mind if you are using a specific branch or commit version that should be reflected in the clone, or remedied after cloning the default branch.
- Clone the dependencies using VCS:
cd ~/rebet_ws
vcs import --input src/rebet_frog/frog.rosinstall src- Source your ROS2 Humble installation, install dependencies using rosdep
source /opt/ros/humble/setup.bash
rosdep install --from-paths src --ignore-src -r -y- To be sure, you should manually install ultralytics
pip install ultralyticsas well as masced_bandits
pip install masced_bandits- Build everything
colcon build --symlink-install- Required for using PRISM adaptation:
cd ~/rebet_ws/src/aal/prism-4.8.1-linux64-x86
./install.sh- Download YOLOv8x model from here and place it in
~/rebet_ws/src/rebet_frog/config/- this limitation comes from the fact that Git LFS cannot be used on forks and the file's size is more than 100MB.
There are myriad launch files which need to be executed. No matter which configuration of rebet_frog you want to use the following launch files should be used:
Make sure you always have the workspace sourced when running these commands (source ~/rebet_ws/install/setup.bash).
Note: you may need to source this first for your gazebo classic to work bash source /usr/share/gazebo/setup.bash.
ros2 launch rebet_frog spawn_tb3.launch.py gui:=true myseed:=3 num_entities:=3For launching the simulation and spawning the turtlebot3 waffle into the world along with randomly (seeded) placed objects.
ros2 launch rebet_frog arborist_config_launch.pyFor managing the behaviour trees.
ros2 run aal adaptation_layerFor providing architectural adaptations of ROS2 Nodes.
ros2 run rebet_frog system_reflection.pyFor collecting and storing system information in the BT's knowledge.
Depending on whether you plan to perform SLAM or use a pre-made map can be specified through the use_map and map_file_name launch arguments (for the latter, available maps are in ~/rebet_ws/src/rebet_frog/config/). When use_map is false, slam_toolbox is launched to create a map.
For SLAM:
ros2 launch rebet_frog navigation_launch.py use_map:=falseand for the pre-made map:
ros2 launch rebet_frog navigation_launch.py use_map:=true map_file_name:=3_hydrants_map.yamlIf you are choosing to perform SLAM, you can automate the process with frontier exploration:
ros2 launch wavefront_frontier frontier_launch.py Some of the missions expect YOLO to be running for object detection.
ros2 launch rebet_frog yolo_self_start_launch.py Ultimately, to start the mission you need to use the following command:
ros2 run rebet_frog tree_action_client.py BT_NAMEwhere BT_NAME matches the name (ID) of a behaviour tree defined in ~/rebet_ws/src/rebet_frog/trees.
Right now, TOAD_PRISM, TOAD_RANDOM, TOAD_GREEDY and TOAD_CONSERVATIVE are provided.
In the case one of the PRISM adaptation strategies is used:
in the behaviour tree, you must provide absolute path to the directory with the PRISM model and other required files in the AdaptNode of the tree as a parameter model_dir="/absolute/path/to/model/dir". The directory should contain following files: base_model.pm, properties.pctl, and utility_function.py in case of DTMC/CTMC and base_model.pm and property.pctl in case of MDP.
The utility_function.py file should define a function named calculate_utility(prop_results), which takes as argument a list corresponding to the results of the properties defined in the properties file. It should return a floating point number indicating the utility associated to the results of the properties. A simple example is provided in the repository in ~/rebet_ws/src/rebet_frog/PRISM_models/max_speed_markov_chain.
In the case of the Markov Chain adaptation strategy, if any of the configuration paramaters can come in the form of strings, you should provide a file named string_config_params.txt that lists all the names of string parameters and their possible values (also works for string arrays). They will be treated as an int value, similar to an enum. This arises from the limitation of PRISM not supporting strings. Each line of the file should look as follows:
string_var_name str_value0 str_value1 ...
An example is present in ~/rebet_ws/src/rebet_frog/PRISM_models/max_speed_markov_chain.