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
评论列表
文章目录