fix: 修正上次提交中的错误
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
import zmq
|
||||
import time
|
||||
import numpy as np
|
||||
from loguru import logger
|
||||
import utils
|
||||
from utils import PidWrap
|
||||
@@ -28,9 +29,10 @@ class main_task():
|
||||
def parse_data(self,data):
|
||||
if data.get('code') == 0:
|
||||
ck_val = data.get('data')
|
||||
# logger.debug(ck_val)
|
||||
if isinstance(ck_val, np.ndarray):
|
||||
self.x = ck_val[0]
|
||||
self.y = ck_val[1]
|
||||
self.x += ck_val[0]
|
||||
self.y += ck_val[1]
|
||||
self.error_counts += 1
|
||||
else:
|
||||
pass
|
||||
@@ -92,7 +94,7 @@ class main_task():
|
||||
# pid_out = self.pid1.get(self.lane_error*0.65)
|
||||
pid_out = self.pid1.get(self.lane_error)
|
||||
# pid_out = -pid_out
|
||||
# logger.debug(f"err={self.lane_error}, pwm out={pid_out}")
|
||||
logger.debug(f"err={self.lane_error}, pwm out={pid_out}")
|
||||
self.by_cmd.send_speed_omega(pid_out)
|
||||
|
||||
self.socket.send_string("")
|
||||
|
||||
Reference in New Issue
Block a user