Compare commits
2 Commits
e82c254dc4
...
605d218b15
| Author | SHA1 | Date | |
|---|---|---|---|
| 605d218b15 | |||
| 968f225526 |
@@ -1162,7 +1162,14 @@ class move_area2():
|
||||
delay_time = 300 + (abs(self.delta_y) * 500)
|
||||
# 离开停车区域
|
||||
by_cmd.send_distance_y(-15, delay_time)
|
||||
|
||||
time.sleep(delay_time / 400 * 1.5)
|
||||
|
||||
for _ in range(3):
|
||||
by_cmd.send_speed_x(0)
|
||||
by_cmd.send_speed_y(0)
|
||||
by_cmd.send_speed_omega(0)
|
||||
|
||||
# FIXME 移动距离指令下发后未完成,再发送速度指令,将不会清除未完成的速度值
|
||||
# by_cmd.send_distance_y(-15, 300)
|
||||
pass
|
||||
|
||||
4
utils.py
4
utils.py
@@ -4,6 +4,7 @@ import numpy as np
|
||||
import erniebot
|
||||
from simple_pid import PID
|
||||
from loguru import logger
|
||||
import threading
|
||||
|
||||
# 巡线误差
|
||||
lane_error = 0
|
||||
@@ -243,6 +244,7 @@ class label_filter:
|
||||
|
||||
class LLM:
|
||||
def __init__(self):
|
||||
self.init_done_flag = False
|
||||
erniebot.api_type = "qianfan"
|
||||
erniebot.ak = "jReawMtWhPu0wrxN9Rp1MzZX"
|
||||
erniebot.sk = "eowS1BqsNgD2i0C9xNnHUVOSNuAzVTh6"
|
||||
@@ -273,6 +275,8 @@ class LLM:
|
||||
def make_message(self,content):
|
||||
return {'role': 'user', 'content': content}
|
||||
def get_command_json(self,chat):
|
||||
while self.init_done_flag == False: # 等待初始化 (要是等到调用还没初始化,那就是真寄了)
|
||||
pass
|
||||
self.messages.append(self.make_message(chat))
|
||||
self.resp = erniebot.ChatCompletion.create(
|
||||
model=self.model,
|
||||
|
||||
Reference in New Issue
Block a user