public void PubChamInfo(CTMA500 tma) { Messages.cham_msgs.ChamInfo msg = new Messages.cham_msgs.ChamInfo(); tma.__update(); msg.xl = tma.PD[1]; msg.xr = tma.PD[0]; msg.yl = tma.PD[3]; msg.yr = tma.PD[2]; chaminfo.publish(msg); }
private void timer1_Tick(object sender, EventArgs e) { if (withTma) { tma.__update(); textBox_AD4.Text = "右x轴: " + tma.PD[0].ToString("F2") + "mm"; textBox_AD5.Text = "左x轴: " + tma.PD[1].ToString("F2") + "mm"; textBox_AD6.Text = "右y轴: " + tma.PD[2].ToString("F2") + "mm"; textBox_AD7.Text = "左y轴: " + tma.PD[3].ToString("F2") + "mm"; } if (withros) { if (ros.isConnect && withTma) { ros.PubChamInfo(tma); } } if (counter % 5 == 0) { //button1_Click(sender, e); } }