def compute_pseudotorques(self): """ Compute Coriolis, Centrifugal, Gravity, Friction and external torques using Newton-Euler algortihm. """ pseudo_robo = copy.deepcopy(self) pseudo_robo.qddot = zeros(pseudo_robo.NL, 1) symo = symbolmgr.SymbolManager() symo.file_open(self, 'ccg') title = "Pseudo forces using Newton-Euler Algorithm\n" if 1 in pseudo_robo.eta: # with flexible joints title = title + "Robot with flexible joints\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.flexible_inverse_dynmodel(pseudo_robo, symo) elif pseudo_robo.is_floating: # with rigid joints and floating base title = title + "Robot with rigid joints and floating base\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.composite_inverse_dynmodel(pseudo_robo, symo) elif pseudo_robo.is_mobile: # mobile robot with rigid joints - known base acceleration title = title + "Robot with mobile base (Vdot0 is known)\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.mobile_inverse_dynmodel(pseudo_robo, symo) else: # with rigid joints and fixed base title = title + "Robot with rigid joints and fixed base\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.fixed_inverse_dynmodel(pseudo_robo, symo) symo.file_close() return symo
def compute_idym(self): """ Compute the Inverse Dynamic Model of the robot using the recursive Newton-Euler algorithm. Also choose the Newton-Euler algorithm based on the robot type. """ symo = symbolmgr.SymbolManager() symo.file_open(self, 'idm') title = "Inverse Dynamic Model using Newton-Euler Algorithm\n" if 1 in self.eta: # with flexible joints title = title + "Robot with flexible joints\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.flexible_inverse_dynmodel(self, symo) elif self.is_floating: # with rigid joints and floating base title = title + "Robot with rigid joints and floating base\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.composite_inverse_dynmodel(self, symo) elif self.is_mobile: # mobile robot with rigid joints - known base acceleration title = title + "Robot with mobile base (Vdot0 is known)\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.mobile_inverse_dynmodel(self, symo) else: # with rigid joints and fixed base title = title + "Robot with rigid joints and fixed base\n" symo.write_params_table(self, title, inert=True, dynam=True) nealgos.fixed_inverse_dynmodel(self, symo) symo.file_close() return symo