Trying to hack ROV pilot controls, NOT WORKING

software

#1

Hi guys,

I am trying to access the motor control of the ROV with a python script. I am following the hints placed by badevguru on the post:

I can access the ‘brightness_update’ and ‘holdHeading_toggle’ commands easily with socket.io, however I am really struggling with being able to access motor controls to rotate left and right and also being able to set ‘targetHeading’ manually. The key emit command I am trying to implement to access the motors is:

from socketIO_client import SocketIO, BaseNamespace
import time
import os
class Namespace(BaseNamespace):

def on_connect(self):
    print('[Connected]')

def on_data_response(*args):
print(‘navdata’, args)

def on_status_response(*args):
print('status ', args)

“”"

def controls(*args):
listb = str(args[0]).split("’")

try:
    throttle = 1
    yaw = 1
    pitch = 1
    roll = 1

“”"
socketIO = SocketIO(‘192.168.254.1’, 8080, Namespace)

sent by OpenROVController.js

‘navdata’ at 10 per sec

#socketIO.on(‘navdata’, on_data_response)

‘status’ at 1 per second (includes navdata)

scanTime = 5 #set time to scan for ROV response
print(‘start’)

print('wait ‘+ str(scanTime) + ’ seconds…’)

socketIO.wait(scanTime)

socketIO.emit(‘control_update’) #<<<<<<<< This is the important command

#although there are inputs after control_update I do not know what structure they are meant to be sent in. Everytime I send a command with ‘control_update’ the ROV starts flashing and stops its connection with the laptop.

I have already uncommented this line in the file rovpilot.js, so i can obtain access to the controls with socket.io.:
// this.cockpit.socket.emit(‘control_update’, controls);

Documentation on how to structure my commands and what commands I am able to send is quite limited. If anyone can teach me the on why my commands aren’t working I would be extremely grateful.