示例#1
0
    def drawEgoVehicle(self):
        egoPoly = self.core.getCurrentEgoPoly()
        pos = self.core.getCurrentEgoPos()
        if pos is not None:
            c = 'black'
            if self.core.getCurrentAcceleration() > 0.3:
                c = 'green'
            if self.core.getCurrentAcceleration() < -0.3:
                c = 'red'
            helper.drawPoint(self.core.getCurrentPath(), color='lightRed')

            helper.drawPoly(egoPoly, color='blue', alpha=1)
            helper.drawHeading(egoPoly, color=c, alpha=1)

            self._x_center = pos[0]
            self._y_center = pos[1]

            p_pose = self.core.getPredictEgo()
            if self._drawPredict:
                for i in range(0, len(p_pose), 2):
                    pp = p_pose[i]
                    helper.drawPoly(pp['poly'],
                                    color='blue',
                                    alpha=0.1,
                                    fill=False)
示例#2
0
    def drawPedestrian(self):
        pedesList = self.core.exportCurrentPedestrian()
        hypoList = self.core.exportHypoPedestrian()

        for hypo in hypoList:
            hc = hypo['c']
            helper.drawPoly(hc['poly'], color='pink', alpha=0.3)
            helper.drawHeading(hc['poly'], color='black', alpha=0.3)

            if self._drawPredictHypo:
                hp = hypo['p']
                for i in range(0, len(hp), 2):
                    hpp = hp[i]
                    helper.drawPoly(hpp['poly'],
                                    color='pink',
                                    alpha=0.1,
                                    fill=False)

        for pedes in pedesList:
            c = pedes['c']
            c_color = 'lightGreen'
            if c['visible']:
                helper.drawPoly(c['poly'], color=c_color, alpha=0.5)
                helper.drawHeading(c['poly'], color='black', alpha=0.5)
            else:
                c_color = 'lightRed'
                helper.drawPoly(c['poly'], color=c_color, alpha=0.5)
                helper.drawHeading(c['poly'], color='black', alpha=0.5)

            if self._drawPredictObject:
                p = pedes['p']
                for i in range(
                        0,
                        len(p),
                ):
                    pp = p[i]
                    helper.drawPoly(pp['poly'],
                                    color=c_color,
                                    alpha=0.1,
                                    fill=False)
示例#3
0
    def drawOtherVehicle(self):
        vehicleList = self.core.exportCurrentVehicle()
        hypoList = self.core.exportHypoVehicle()

        for hypo in hypoList:
            hc = hypo['c']
            helper.drawPoly(hc['poly'], color='yellow', alpha=0.3)
            helper.drawHeading(hc['poly'], color='black', alpha=0.3)

            if self._drawPredictHypo:
                hp = hypo['p']
                for i in range(0, len(hp), 2):
                    hpp = hp[i]
                    helper.drawPoly(hpp['poly'],
                                    color='yellow',
                                    alpha=0.1,
                                    fill=False)

        for vehicle in vehicleList:
            c = vehicle['c']
            c_color = 'green'
            if c['visible']:
                helper.drawPoly(c['poly'], color='green', alpha=0.5)
                helper.drawHeading(c['poly'], color='black', alpha=0.5)
            else:
                c_color = 'red'
                helper.drawPoly(c['poly'], color='red', alpha=0.5)
                helper.drawHeading(c['poly'], color='black', alpha=0.5)

            if self._drawPredictObject:
                p = vehicle['p']
                for i in range(0, len(p), 2):
                    pp = p[i]
                    helper.drawPoly(pp['poly'],
                                    color=c_color,
                                    alpha=0.1,
                                    fill=False)
示例#4
0
 def drawFOV(self):
     l_FOV = self.core.getCurrentFOV()
     helper.drawPoly(l_FOV, color='lightBlue', alpha=0.3, fill=False)
示例#5
0
 def drawStaticObject(self):
     objectList = self.core._env._l_staticObject
     for obj in objectList:
         helper.drawPoly(obj._poly, color='gray', alpha=0.5)