全新的V2.1版本发布了,根据实际需要后面会完善基本功能,并开发出更实用的功能模块,欢迎小伙伴们留言。详细更新内容介绍如下:
更新1:新增显示程序指针运行行号,方便了解程序执行到哪一行。
更新2:新增按钮互锁功能,模拟现实示教器操作步骤,并防止不懂机器人的操作的小伙伴误操作。
更新3:在查看所有例行程序名的下拉框基础上,新增程序指针移至该例行程序。。
更新4:新增底部状态栏显示,实时监控机器人的模式、电机状态、运行状态。
更新5:新增机器人位置信息栏,实时刷新当前机器人大地坐标、关节坐标
更新6:新增机器人位置信息栏,实时刷新当前机器人工具坐标,工件坐标系。
更新7:界面优化,限定界面大小,按钮位置等等。
按照国际惯例 附上部分源码:
private void timer_get_pose_Tick(object sender, EventArgs e)
{
//定时任务1s获取机器人坐标
double rx;
double ry;
double rz;
JointTarget aJointTarget = controller.MotionSystem.ActiveMechanicalUnit.GetPosition();
aRobTarget = controller.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.Base);
Tool tool = controller.MotionSystem.ActiveMechanicalUnit.Tool;
WorkObject workobj = controller.MotionSystem.ActiveMechanicalUnit.WorkObject;
ToolData t = (ToolData)tool.Data;
WobjData wobj = (WobjData)workobj.Data;
string s1 = "";
s1 = "当前工具:" + tool.Name + " ";
s1 = s1 + t.Tframe.ToString() + "\r\n";
s1 = s1 + "当前工件坐标系:" + workobj.Name + " ";
s1 = s1 + "Uframe " + wobj.Uframe.ToString() + " ";
// 跨线程访问
Action action = () =>
{
string CoordinateName = PoseShowcomboBox1.Text;
if (CoordinateName == "大地坐标系")
{
aRobTarget = controller.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.World);
}
else if (CoordinateName == "基座标系")
{
aRobTarget = controller.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.Base);
}
else if (CoordinateName == "工件坐标系")
{
aRobTarget = controller.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.WorkObject);
}
textBoxX.Text = aRobTarget.Trans.X.ToString(format: "#0.00");
textBoxY.Text = aRobTarget.Trans.Y.ToString(format: "#0.00");
textBoxZ.Text = aRobTarget.Trans.Z.ToString(format: "#0.00");
aRobTarget.Rot.ToEulerAngles(out rx, out ry, out rz);
textBoxRX.Text = rz.ToString(format: "#0.00");
textBoxRY.Text = ry.ToString(format: "#0.00");
textBoxRZ.Text = rx.ToString(format: "#0.00");
textBoxJ1.Text = aJointTarget.RobAx.Rax_1.ToString(format: "#0.00");
textBoxJ2.Text = aJointTarget.RobAx.Rax_2.ToString(format: "#0.00");
textBoxJ3.Text = aJointTarget.RobAx.Rax_3.ToString(format: "#0.00");
textBoxJ4.Text = aJointTarget.RobAx.Rax_4.ToString(format: "#0.00");
textBoxJ5.Text = aJointTarget.RobAx.Rax_5.ToString(format: "#0.00");
textBoxJ6.Text = aJointTarget.RobAx.Rax_6.ToString(format: "#0.00");
textBoxq1.Text = aRobTarget.Rot.Q1.ToString(format: "#0.00000");
textBoxq2.Text = aRobTarget.Rot.Q2.ToString(format: "#0.00000");
textBoxq3.Text = aRobTarget.Rot.Q3.ToString(format: "#0.00000");
textBoxq4.Text = aRobTarget.Rot.Q4.ToString(format: "#0.00000");
TemprichTextBox.Clear();
TemprichTextBox.Text = s1;
};
this.Invoke(action);