instructions for using both the offline and online monitors with ROSMonitoring:
- ROS 2 Humble
behaviortree_cpp_v3
library- Groot (for visualizing behavior trees)
-
Clone the Repository:
Open a terminal and execute the following commands:
mkdir -p ~/ros_ws/src cd ~/ros_ws/src git clone <current_repo_url> cd ~/ros_ws colcon build
-
Run the Behavior Tree:
ros2 run bt_bumpgo bt_bumpgo_main ros2 run groot Groot # Start Groot for visualization
In Groot:
- Select
Monitor
->Start
->Connect Local
to visualize the behavior tree graph.
- Select
-
Clone the ROSMonitoring Package:
Clone the ROSMonitoring package from the repository:
cd ~/ git clone https://github.com/autonomy-and-verification-uol/ROSMonitoring.git cd ROSMonitoring git checkout ros2
-
Create a Simple Offline Monitor:
- Copy the offline configuration file from the current repository to the ROSMonitoring repository.
- The ROSMonitoring repository does not need to be in your ROS workspace; it can be executed separately.
cd ~/ROSMonitoring/generator/ros2_devel/ chmod +x generator python3 ./generator --config_file offline_config.yaml
If you encounter any errors, follow these steps in your ros_ws
:
rm -rf build install log
source /opt/ros/humble/setup.bash
colcon build
-
Start the ROS Monitoring Tool:
In a terminal, run:
cd ~/ros_ws/ . install/setup.bash ros2 launch src/monitor/launch/monitor.launch
-
Run the Instrumented Launch File:
In another terminal, execute:
cd ~/ros_ws/ . install/setup.bash ros2 launch src/Bump-and-Go-with-Behavior-Trees/launch/run_instrumented.launch
Or use:
ros2 launch src/Bump-and-Go-with-Behavior-Trees/launch/run_launch.py
-
Copy the Log File:
cp ~/ros_ws/log.txt ~/ROSMonitoring/oracle/
-
Analyze the Log File with the RML Oracle:
cd ~/ROSMonitoring/oracle/RMLOracle/prolog/ sh offline_monitor.sh ../rml/test.pl ../../log.txt
-
Analyze the Log File with the TL Oracle:
cd ~/ROSMonitoring/oracle/TLOracle/ ./oracle.py --offline --property property --trace ../../log.txt --discrete
-
Generate the Online Monitor:
cd ~/ROSMonitoring/generator/ros2_devel/ chmod +x generator ./generator --config_file online_config.yaml
-
Run the Online Monitor with RML Oracle:
Before running the online monitor, execute the web server for Prolog:
cd ~/ROSMonitoring/oracle/RMLOracle/prolog/ sh online_monitor.sh ../rml/test.pl 8080
This starts the server at
http://127.0.0.1:8080/
. -
Run the Online Oracle with TL Properties:
cd ~/ROSMonitoring/oracle/TLOracle/ ./oracle.py --online --property property --port 8080 --discrete
- A
log.txt
file will be generated in your repository directory. ( for offline monitor), for online monitor a server will run on http://127.0.0.8080/