def cb_resultrt(msg): global error_code, proc_mssage, fromUI print "cb_result_master_teach called!" print "cb_result_master_teach msg len=", len(msg.data) #rt[1,16]を[4,4]に変換 RT = np.array(msg.data).reshape([4,4]) print "cb_result_master_teach RT=", RT size = np.prod(RT.shape) f = Floats() f.data = np2F(RT.reshape(1,size)).data pub_RT.publish(f) publish_retCode_and_message(str(error_code),str(proc_message)) if(fromUI == False): pub_Y2.publish(True) return
def np2F(d): #numpy to Floats f=Floats() f.data=np.ravel(d) return f
def np2FmNoDivide(d): #numpy to Floats (unit is already meter for RViZ) f=Floats() f.data=np.ravel(d) return f
def np2Fm(d): #numpy to Floats (unit is meter for RViZ) f=Floats() f.data=np.ravel(d) / 1000.0 return f