ISAR - Integration and Supervisory control of Autonomous Robots - is a tool for integrating robot applications into Equinor systems. Through the ISAR API you can send command to a robot to do missions and collect results from the missions.
The system consists of two threads running in parallel.
- State machine
- Flask API
The state machine handles interaction with the robots API and monitors the execution of missions. It also enables interacting with the robot before, during and after missions.
The state machine is based on the transitions package for Python. Its main states are:
- Idle: The robot is in an idle state and ready to perform new missions.
- Send: The state machine has received a mission and is sending the mission to the robot.
- Monitor: The robot has received a mission from the state machine, and the state machine is monitoring the current mission.
- Collect: The state collects data during a mission.
- Cancel: The state machine has received a request to abort, or an event has occurred which requires the mission to be canceled. The cancel state also functions as a wrap-up state when a mission is finished, prior to the state machine returning to idle.
The Flask API establishes an interface to the state machine for the user. As the API and state machine are separate threads, they communicate through python queues. The main flask extension used for the API design is the flask-restx package.
$ pip install git+https://github.com/equinor/isar.git@main
Note, installation might require wheel.
To run ISAR:
$ python -m flask run --no-reload
For local development, please fork the repository. Then, clone and install in the repository root folder:
$ git clone https://github.com/equinor/isar
$ cd isar
$ pip install -e ".[dev]"
Set environment to local:
$ export ENVIRONMENT=local
Verify that you can run the tests:
$ pytest .
To connect the state machine to a robot in a seperate repository, it is required that the seperate repository implements the robot interface. Install the repo, i.e:
$ pip install git+https://@github.com/equinor/isar-robot.git@main
Then, set an environment variable to the name of the package you installed:
$ export ROBOT_DIRECTORY=isar_robot
If you have the robot repository locally, you can simply install through
$ pip install -e /path/to/robot/repo/
After following the steps in Development, you can run the tests:
$ pytest -n 10
We welcome all kinds of contributions, including code, bug reports, issues, feature requests, and documentation. The preferred way of submitting a contribution is to either make an issue on github or by forking the project on github and making a pull requests.