|
@@ -121,7 +121,8 @@ class MapGLWidget(PyGLWidget):
|
|
|
glVertex2d(x, y)
|
|
|
glVertex2d(y_source[0], y_source[1])
|
|
|
glEnd()
|
|
|
- def DrawAGV(self,pose,rgb,label=""):
|
|
|
+
|
|
|
+ def DrawMainAGV(self,pose,rgb,label):
|
|
|
[x,y,yaw]=pose
|
|
|
l=0.8 #轮长
|
|
|
L=1.3 #轴距
|
|
@@ -151,8 +152,54 @@ class MapGLWidget(PyGLWidget):
|
|
|
glVertex2d(pt8[0],pt8[1])
|
|
|
glEnd()
|
|
|
|
|
|
+ glLineWidth(3)
|
|
|
+ glBegin(GL_LINES)
|
|
|
+ glVertex2d(pt2[0],pt2[1])
|
|
|
+ glVertex2d(pt6[0],pt6[1])
|
|
|
+ glVertex2d(pt3[0],pt3[1])
|
|
|
+ glVertex2d(pt7[0],pt7[1])
|
|
|
+
|
|
|
+ glVertex2d(pt2[0],pt2[1])
|
|
|
+ glVertex2d(pt3[0],pt3[1])
|
|
|
+ glVertex2d(pt6[0],pt6[1])
|
|
|
+ glVertex2d(pt7[0],pt7[1])
|
|
|
+ glEnd()
|
|
|
+ #绘制方向
|
|
|
+ self.drawAxis(pose,1.2,5)
|
|
|
+ color=[0,0,0]
|
|
|
+ self.DrawText([x-W/2,y-l/2],label,5,1.5,color)
|
|
|
+ def DrawAGV(self,pose,rgb,label=""):
|
|
|
+ [x,y,yaw]=pose
|
|
|
+ l=0.8 #轮长
|
|
|
+ L=1.3 #轴距
|
|
|
+ W=2.5 #宽
|
|
|
+ pt1=self.Transform([-(L+l)/2,W/2],yaw,[x,y])
|
|
|
+ pt2=self.Transform([-(L-l)/2,W/2],yaw,[x,y])
|
|
|
+ pt3=self.Transform([(L-l)/2,W/2],yaw,[x,y])
|
|
|
+ pt4=self.Transform([(L+l)/2,W/2],yaw,[x,y])
|
|
|
+
|
|
|
+ pt5=self.Transform([-(L+l)/2,-W/2],yaw,[x,y])
|
|
|
+ pt6=self.Transform([-(L-l)/2,-W/2],yaw,[x,y])
|
|
|
+ pt7=self.Transform([(L-l)/2,-W/2],yaw,[x,y])
|
|
|
+ pt8=self.Transform([(L+l)/2,-W/2],yaw,[x,y])
|
|
|
+
|
|
|
+ glDepthMask(GL_FALSE)
|
|
|
+ glColor3f(rgb[0],rgb[1],rgb[2])
|
|
|
+
|
|
|
glLineWidth(5)
|
|
|
glBegin(GL_LINES)
|
|
|
+ glVertex2d(pt1[0],pt1[1])
|
|
|
+ glVertex2d(pt2[0],pt2[1])
|
|
|
+ glVertex2d(pt3[0],pt3[1])
|
|
|
+ glVertex2d(pt4[0],pt4[1])
|
|
|
+ glVertex2d(pt5[0],pt5[1])
|
|
|
+ glVertex2d(pt6[0],pt6[1])
|
|
|
+ glVertex2d(pt7[0],pt7[1])
|
|
|
+ glVertex2d(pt8[0],pt8[1])
|
|
|
+ glEnd()
|
|
|
+
|
|
|
+ glLineWidth(1)
|
|
|
+ glBegin(GL_LINES)
|
|
|
glVertex2d(pt2[0],pt2[1])
|
|
|
glVertex2d(pt6[0],pt6[1])
|
|
|
glVertex2d(pt3[0],pt3[1])
|
|
@@ -194,7 +241,10 @@ class MapGLWidget(PyGLWidget):
|
|
|
x = agv_statu.x
|
|
|
y = agv_statu.y
|
|
|
theta = agv_statu.theta
|
|
|
- self.DrawAGV([x, y, theta], robot.robotColor_,robot.name_)
|
|
|
+ if robot.IsMainAgv():
|
|
|
+ self.DrawMainAGV([x, y, theta], robot.Color(),robot.name_)
|
|
|
+ else:
|
|
|
+ self.DrawAGV([x, y, theta], robot.Color(),robot.name_)
|
|
|
|
|
|
if robot.timedNavStatu_.timeout() == False:
|
|
|
select_traj = robot.MpcSelectTraj()
|
|
@@ -207,7 +257,7 @@ class MapGLWidget(PyGLWidget):
|
|
|
self.drawAxis([0, 0, 0], 3, 2)
|
|
|
|
|
|
#绘制地图
|
|
|
- for road in self.roads.items():
|
|
|
+ '''for road in self.roads.items():
|
|
|
[_, value] = road
|
|
|
for nodeId in value:
|
|
|
for nextId in value:
|
|
@@ -220,10 +270,10 @@ class MapGLWidget(PyGLWidget):
|
|
|
if type == "street_node":
|
|
|
self.drawNode(point, 30, [0, 0.5, 0.5],name)
|
|
|
if type == "space_node":
|
|
|
- self.drawNode(point, 20, [0.3, 0.8, 0.7],name)
|
|
|
+ self.drawNode(point, 20, [0.3, 0.8, 0.7],name)'''
|
|
|
|
|
|
#绘制agv相关数据,路径、轨迹、位姿
|
|
|
self.DrawRobotData(self.robot1_)
|
|
|
self.DrawRobotData(self.robot2_)
|
|
|
- self.DrawRobotData(self.robotMain_)
|
|
|
+
|
|
|
|