meta-control / mc_mros_reasoner

library for metacontrol-based self-adaptation using ontological reasoning, with wrappers for robotic systems based on ROS1 and ROS2
Apache License 2.0
7 stars 10 forks source link
ontology owlready2 robotics ros ros2-foxy self-adaptive software-architecture

mros_reasoner

A meta-controller implementation for ROS2

Note:

This branch is highly experimental and unstable

Installation

Create mros_reasoner workspace

  mkdir -p ~/mros_reasoner_ws/src
  cd mros_reasoner_ws

Get mros2_reasoner

  cd ~/mros_reasoner_ws/src
  git clone --branch humble https://github.com/meta-control/mc_mros_reasoner.git

Install deps:

  cd ~/mros_reasoner_ws/
  vcs import src < src/mc_mros_reasoner/mros2_reasoner.rosinstall
  rosdep install --from-paths src --ignore-src -r -y

Build MROS2 workspace

cd ~/mros_reasoner_ws/src
source /opt/ros/humble/setup.bash
colcon build --symlink-install

Example - Pilot URJC

Disclaimer: The example might not work for all ros2 versions supported by MROS. Check the example page to find out which versions are supported.

Build workspace with example

Make sure to rebuild the workspace after you get the example code.

cd ~/mros_reasoner_ws/src
source /opt/ros/hubmle/setup.bash
colcon build --symlink-install

Execution - with simulated turtlebot3

  1. Launch turtlebot3 world in gazebo sim

      export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:[ros2_ws]/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models
      export TURTLEBOT3_MODEL=${TB3_MODEL}
      ros2 launch pilot_urjc_bringup tb3_sim_launch.py
    • After the last command, the Gazebo simulator is running in background. Don't worry if no window is opened.
  2. Turtlebot3 Navigation launcher

    This launcher includes rviz, nav2, amcl, map-server, system-modes, etc. The system_modes mode_manager takes the modes description from params/pilot_modes.yaml.

      export TURTLEBOT3_MODEL=${TB3_MODEL}
      ros2 launch pilot_urjc_bringup nav2_turtlebot3_launch.py
    • RVIz opens, and the navigation system is waiting for the activation of the laser_driver. It is not necessary to set an initial robot position with the 2D Pose Estimate tool. When the laser_driver is up, the pose will be set automatically.
  3. Launch the mros2 metacontroller

    This step launches the mros2_metacontroller, it launches by default the kb.owl ontology and connects to the system_modes created by the pilot_urjc

    • The names of the modes there have been changed to match the fd names of the kb.owl ontology.
      ros2 launch mros2_reasoner launch_reasoner.launch.py

By default it sets the f3_v3_r1 mode which corresponds to the NORMAL mode.

With all the above, we will have enough to test some navigation actions and experiment changing the current mode and seeing how this change affects the navigation.

  1. Publish energy values