Skip to content
Snippets Groups Projects
Commit d9a28d3e authored by Lacroix Paul's avatar Lacroix Paul
Browse files

update MCL

parent 2a1cca80
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,6 @@ h_reel = 0.234 #Hauteur d'un plot
y_0 = 1500 #Milieu de l'image
dist_roue = 0.25 #Distance entre les roues avant et les roues arrieres
dt = 0.1 #Frequence de calcul
# class position:
......@@ -95,8 +94,10 @@ def distance_Chamfer(A_x, A_y, B_x, B_y):
def motion_update(commande, position):
vitesse, direction = commande
vitesse, direction, FPS = commande
x,y,theta = position
dt = 1/FPS
if direction ==0:
new_x = x + dt*vitesse*cos(theta)
......
File added
No preview for this file type
No preview for this file type
......@@ -203,7 +203,7 @@ def draw_bbox(image, bboxes,liste_pos_car, CLASSES=YOLO_COCO_CLASSES, show_label
#Determination de la position de la voiture
#speed with 10= 3.8/40
pos_car, liste_pos_car_temp = get_position(bboxes, (previous_command[0]*3.7/170, previous_command[1]/200*35/360*2*3.1415), liste_pos_car.liste)
pos_car, liste_pos_car_temp = get_position(bboxes, (previous_command[0]*3.7/170, previous_command[1]/200*35/360*2*3.1415, previous_command[2]), liste_pos_car.liste)
liste_pos_car.update_liste(liste_pos_car_temp)
"""Algorithme de conduite"""
......@@ -633,7 +633,7 @@ def detect_realtime(Yolo, output_path, input_size=416, show=False, CLASSES=YOLO_
print("Time: {:.2f}ms, {:.1f} FPS".format(ms, fps))
frame, command, liste_pos_car = draw_bbox(original_frame, bboxes,liste_pos_car, CLASSES=CLASSES, rectangle_colors=rectangle_colors, ser=ser, previous_command=(10, command))
frame, command, liste_pos_car = draw_bbox(original_frame, bboxes,liste_pos_car, CLASSES=CLASSES, rectangle_colors=rectangle_colors, ser=ser, previous_command=(10, command, fps))
# CreateXMLfile("XML_Detections", str(int(time.time())), original_frame, bboxes, read_class_names(CLASSES))
image = cv2.putText(frame, "Time: {:.1f}FPS".format(fps), (0, 30),
cv2.FONT_HERSHEY_COMPLEX_SMALL, 1, (0, 0, 255), 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment