Skip to main content

ROV Library

A custom library developed by RobEn that exactly fits our needs, be it programmatically controlling a Remote Operated Vehicle (ROV) or processing image data from the on-board cameras, it's got you covered.

Table of contents 🗒

Installing ⬇

The module is available at pypi, download with a simple

$ pip install rovlib

General Usage 🔑

Like any other 3rd party module you can easily import the desired sub-module by specifying what you want from the main rovlib module

from rovlib.cameras import RovCam
# or
from rovlib.control import RovMavlink, JoyStickControl

More about rovlib.cameras ? ➡ Cameras module
More about rovlib.control ? ➡ Control module


ROV-cameras 🎥

The camera module is required to receive OpenCV frames from ROV cameras being sent by the On board camera system used in conjunction with this user level module.

How to use it 🔧

Starting a camera 🟢

To start capturing frames from a specific camera you have to start an instance of RovCam similarly as starting a cv2.VideoCapture() instance from opencv.

As it might seem the interface is very similar to OpenCV's as the image data is originally captured on the ROV with OpenCV so it is required to run the script.

from rovlib.cameras import RovCam
import cv2

cam = RovCam(RovCam.FRONT)

while True:
  image = cam.read()

  cv2.imshow("ROV", image)

  if cv2.waitKey(1) & 0xFF == ord('q'):
    break

cv2.destroyAllWindows()

The RovCam instance requires the user to specify which camera to get image data from, only a supported camera would work

Camera Options 📸

As for now the camera option are:

Front main camera looking ahead

RovCam.FRONT

Arm facing camera looking exactly at the robotic arm

RovCam.ARM

Misc cameras looking wherever we need to position them (still not supported in this version)

RovCam.MISC1 RovCam.MISC2


ROV-control 🕹

It is a python sub-module that simplifies the use of pymavlink APIs, to ease the control of our beloved Alenda (the ROV).

How to use it 🔧

Establish communication 🤝

# create an instance of RovMavlink
# Those are the default constructor params.
rov = RovMavlink(connection_type = 'udpin', connection_ip = '0.0.0.0', connection_port = '14550', silent_mode = True)
# Binds to the port in the given address
rov.establish_connection()

To start controlling the vehicle you should Arm it first. To arm it use there following commands.

# Silent mode is used to shut off prints from the used functions for instance - > 'vehicle Armed successfully'
rov = RovMavlink(silent_mode=False).establish_connection()
rov.arm_vehicle() # you only need to arm the vehicle once, there is no need to arm it every time you want to stablize it

# to disarm vehicle
rov.disarm_vehicle()

Set vehicle mode 🎯

rov = RovMavlink().establish_connection()
rov.arm_vehicle()
rov.set_vehicle_mode(rov.Mode.STABILIZE)

Those are all the modes you would need to use. If you used set_vehicle_mode() with any thing other that Mode enum it would raise a violation ❌.

class Mode(IntEnum):
    STABILIZE = 0
    ACRO = 1
    ALT_HOLD = 2
    AUTO = 3
    GUIDED = 4
    CIRCLE = 7
    SURFACE = 9
    POSHOLD = 16
    MANUAL = 19

# use them as follows
# rov.set_vehicle_mode(Mode.STABILIZE)

sending custom control 🎮

⚠ Take care the throttle of x, y, z and rotation is a value between -1 to 1. any value out side this boundry will raise a violation. ❌🔞

rov.send_control(JoyStickControl(x_throttle = 0.5, y_throttle = 0.5, z_throttle = 0, rotation_throttle = 1))

also you can it as follows ⬇

rov = RovMavlink(silent_mode=False).establish_connection()
period = 10 # period for moving the joystick control in seconds
rov.arm_vehicle()
# my_lovely_fake_joy_stick = JoyStickControl(x_throttle=1, y_throttle=1) # name the param u want to add and give it a value between -1 to 1
my_lovely_fake_joy_stick = JoyStickControl(y_throttle=0.8)
rov.send_control(my_lovely_fake_joy_stick)

Orientation of the ROV 🧭

ROV-Orienation

Authors

Release files for rovlib 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rovlib 1.1.0
File Size Uploaded
rovlib-1.1.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rovlib 1.1.0
File Interpreter ABI Platform
rovlib-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size:13.5 kB

Release files / rovlib-1.1.0.tar.gz

Download URL rovlib-1.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4051effd466aeddf71573d5f44bff1100f0305aa35d8df5f20febcd0db252fd3
BLAKE2b-256 checksum
How to use checksums
800faec4eb91b0c01caca89e89386d06875b570712a189ef71272ad4198d443b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / rovlib-1.1.0-py3-none-any.whl

Download URL rovlib-1.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9177cfb10519df72024a4d060820fc8ac9c2541a3b329c95ab4035b3cc8baa4b
BLAKE2b-256 checksum
How to use checksums
623f2c7a5b8cd8a4b0a73ea8b76c0bb61f6d039b0561438fdb12d95cdd97eea2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page