def render(self, mode='human', close=False): """ Parameters ---------- mode : close : Returns ------- n/a """ if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="Trajectory") self.init_rendering = True self.ani.draw_goal(self.zero) #for p in self.pts: # self.ani.draw_goal(p[1:], (0.5,0,0.5)) for i in range(len(self.waypoint_list)): wp = self.waypoint_list[i] self.ani.draw_goal(wp) self.ani.draw_goal(self.goal_xyz, color=(0.5, 0, 0)) for s in self.obstacles: self.ani.draw_sphere(s.get_center(), s.get_radius()) self.ani.draw_label("Step: {}".format(self.count), (self.ani.window.width // 2, 20.0)) self.ani.draw()
def render(self, mode='human', close=False): """ Parameters ---------- mode : close : Returns ------- n/a """ if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="Trajectory") self.init_rendering = True self.ani.draw_quadrotor(self.iris) self.ani.draw_goal(self.zero) for i in range(len(self.waypoint_list)-1): wp = self.waypoint_list[i] if i == 0: self.ani.draw_line(self.zero, wp) else: self.ani.draw_line(wp, self.waypoint_list[i-1]) self.ani.draw_goal(wp) for s in self.obstacles: self.ani.draw_sphere(s.get_center(), s.get_radius()) self.ani.draw_goal(self.goal_xyz, color=(0.5,0,0)) self.ani.draw_label("Time: {0:.2f}".format(self.t*self.ctrl_dt), (self.ani.window.width // 2, 20.0)) self.ani.draw()
def render(self, mode='human', close=False): if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="Static Waypoint") self.init_rendering = True self.ani.draw_goal([0, 0, 0], color=(1, 0, 0)) self.ani.draw_quadrotor(self) self.ani.draw_label("Time: {0:.2f}".format(self.t), (self.ani.window.width // 2, 20.0))
def render(self, mode='human', close=False): if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="Hover") self.init_rendering = True self.ani.draw_quadrotor(self.iris) self.ani.draw_goal(self.goal_xyz) self.ani.draw_label("Time: {0:.2f}".format(self.t*self.ctrl_dt), (self.ani.window.width // 2, 20.0)) self.ani.draw()
def renderGl(self): if(not self.init_rendering): self.ani = ani_gl.VisualizationGL(name="Hover"); self.init_rendering = True; self.ani.draw_quadrotor(self.iris); self.ani.draw_goal(self.goal_xyz); self.ani.draw_goal(np.array([[1.0], [0.0], [0.0]])); self.ani.draw_goal(np.array([[-1.0], [0.0], [0.0]])); self.ani.draw_goal(np.array([[0.0], [0.0], [1.0]])); self.ani.draw_goal(np.array([[0.0], [0.0], [-91.0]])); self.ani.draw_label("Time: {0:.2f}".format(self.t), (self.ani.window.width // 2, 20.0)); self.ani.draw(); print("GL render disabled")
def renderGl(self, mode='human'): #If first call to render, initialize rendering if(not self.init_rendering): self.ani = ani_gl.VisualizationGL(name="Target Following", x_dim=self.x_dim, y_dim=self.y_dim, z_dim=self.z_dim); self.init_rendering = True; self.ani.draw_quadrotor(self.iris); self.ani.draw_goal(self.goal_xyz, color=(1,1,0)); self.ani.draw_label("Time: {0:.2f}".format(self.t), (self.ani.window.width // 2, 20.0)); self.ani.draw(); #Slow down animation to a reasonable watching speed if(mode == 'human'): time.sleep(0.05);
def render(self, mode='human', close=False): """ Parameters ---------- mode : close : Returns ------- n/a """ if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="RandomWaypoint") self.init_rendering = True self.ani.draw_quadrotor(self.iris) self.ani.draw_goal(self.goal_xyz) self.ani.draw_label("Time: {0:.2f}".format(self.t * self.ctrl_dt), (self.ani.window.width // 2, 20.0)) self.ani.draw()
def render(self, mode='human', close=False): """ Parameters ---------- mode : close : Returns ------- n/a """ if not self.init_rendering: self.ani = ani_gl.VisualizationGL(name="Trajectory") self.init_rendering = True for i in range(len(self.waypoint_list)): wp = self.waypoint_list[i] self.ani.draw_goal(wp) self.ani.draw_goal(self.goal_xyz, color=(0.5, 0, 0)) self.ani.draw_label("Time: {0:.2f}".format(self.count), (self.ani.window.width // 2, 20.0)) self.ani.draw()