fix: Typo
This commit is contained in:
parent
6ed7a603fc
commit
3a6ca29560
11
单摄像头.py
11
单摄像头.py
|
@ -2,6 +2,7 @@
|
||||||
@Author : kazimiyuuka
|
@Author : kazimiyuuka
|
||||||
@Date : 2023/05/29 23:51
|
@Date : 2023/05/29 23:51
|
||||||
@LastEditors : raiot
|
@LastEditors : raiot
|
||||||
|
@Environment : python 3.10
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,8 +10,8 @@ import serial
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
import time
|
||||||
|
import math
|
||||||
|
|
||||||
import serial
|
|
||||||
|
|
||||||
class Ship:
|
class Ship:
|
||||||
# @parameter badudrate 波特率
|
# @parameter badudrate 波特率
|
||||||
|
@ -112,13 +113,13 @@ class Ship:
|
||||||
tmp = 0x2d
|
tmp = 0x2d
|
||||||
self.sendMessage(tmp, 0.0)
|
self.sendMessage(tmp, 0.0)
|
||||||
|
|
||||||
def setForward_Thrust(self):
|
def setForward_Thrust(self, val:float):
|
||||||
tmp = 0x2f
|
tmp = 0x2f
|
||||||
self.sendMessage(tmp, val)
|
self.sendMessage(tmp, val)
|
||||||
|
|
||||||
def setSidesway_Thrust(sekf , val : float):
|
def setSidesway_Thrust(self , val: float):
|
||||||
tmp = 0x30
|
tmp = 0x30
|
||||||
self.sendMessage(tep ,val)
|
self.sendMessage(tmp ,val)
|
||||||
|
|
||||||
def setYaw_Rotate_Torque(self , val : float):
|
def setYaw_Rotate_Torque(self , val : float):
|
||||||
tmp = 0x32
|
tmp = 0x32
|
||||||
|
@ -129,7 +130,7 @@ class SVM:
|
||||||
def __init__(self , path : str):
|
def __init__(self , path : str):
|
||||||
self.model = cv2.ml.SVM_load(path)
|
self.model = cv2.ml.SVM_load(path)
|
||||||
|
|
||||||
def predicted(img):
|
def predicted(self, img):
|
||||||
_ , res = self.model.predicted(img)
|
_ , res = self.model.predicted(img)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue