Simulation.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:robotics1project 作者: pchorak 项目源码 文件源码
def display(self,angles):
        """
        Plots wireframe models of the Dobot and obstacles.
        """
        arm = DobotModel.get_mesh(angles)

        #fig = plt.figure()
        fig = plt.gcf()
        ax = Axes3D(fig)
        #plt.axis('equal')
        for Ta in arm:
            ax.plot(Ta[[0,1,2,0],0],Ta[[0,1,2,0],1],Ta[[0,1,2,0],2],'b')
        for To in self.obstacles:
            ax.plot(To[[0,1,2,0],0],To[[0,1,2,0],1],To[[0,1,2,0],2],'b')

        r_max = DobotModel.l1 + DobotModel.l2 + DobotModel.d

        plt.xlim([-np.ceil(r_max/np.sqrt(2)),r_max])
        plt.ylim([-r_max,r_max])
        ax.set_zlim(-150, 250)
        ax.view_init(elev=30.0, azim=60.0)
        plt.show()
        return fig
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号