def PublishToQuad(self,Input_to_Quad): # create a message of the type quad_cmd, that the simulator subscribes to cmd = quad_cmd() cmd.cmd_1 = Input_to_Quad[0]; cmd.cmd_2 = Input_to_Quad[1]; cmd.cmd_3 = Input_to_Quad[2]; cmd.cmd_4 = Input_to_Quad[3]; cmd.cmd_5 = 1500.0; cmd.cmd_6 = 1500.0; cmd.cmd_7 = 1500.0; cmd.cmd_8 = 1500.0 self.pub_cmd.publish(cmd)
def PublishToQuad(self, Input_to_Quad): # create a message of the type quad_cmd, that the simulator subscribes to cmd = quad_cmd() cmd.cmd_1 = Input_to_Quad[0] cmd.cmd_2 = Input_to_Quad[1] cmd.cmd_3 = Input_to_Quad[2] cmd.cmd_4 = Input_to_Quad[3] cmd.cmd_5 = 1500.0 cmd.cmd_6 = 1500.0 cmd.cmd_7 = 1500.0 cmd.cmd_8 = 1500.0 self.pub_cmd.publish(cmd)
def real_publish(self,desired_3d_force_quad,yaw_rate,rc_output): # create a message of the type quad_cmd, that the simulator subscribes to cmd = quad_cmd() cmd.cmd_1 = rc_output[0] cmd.cmd_2 = rc_output[1] cmd.cmd_3 = rc_output[2] cmd.cmd_4 = rc_output[3] cmd.cmd_5 = 1500.0 cmd.cmd_6 = 1500.0 cmd.cmd_7 = 1500.0 cmd.cmd_8 = 1500.0 self.pub_cmd.publish(cmd)