RobotStudio event

[PC SDK] Writing RobTarget in Controller doesn't work as expected

HM
HM
edited February 2014 in Developer Tools
Hi,

I´m developing an add-in which copies a robtarget to the controller and moves the robot to it. In depth, the program calculates some robtargets in simulation, the reachability is checked and, if the target is reachable, the robtarget is copied to the controller and the robot moves to it.

I have some problems with the execution. First problem, once the controller's robtarget is overwritten with the new value and the execution is played, the robot starts moving, but it moves near to the origin. I think that the problem is on units: simulation works with meters and controller is waiting milimeters, am I right?

Assuming this is true, I transform the translation units in milimeters, and run the program again. Then the robot doesn't move, and I can't imagine what is happening now. Fist I thought that the position is not reachable but this is checked as true in simulation.

I followed this discussion: http://forums.robotstudio.com/discussion/comment/23026#Comment_23026 and the PC SDK manual so I assume that the robtarget is correctly written (in fact the new value is written in the controller's robtarget).

Any ideas are welcome.
HM

if (rd.Value is ABB.Robotics.Controllers.RapidDomain.RobTarget)
{
	ABB.Robotics.Controllers.RapidDomain.RobTarget probTarget = (ABB.Robotics.Controllers.RapidDomain.RobTarget)rd.Value;
	string newValue = GetString(rs);
	probTarget.FillFromString2(newValue);
	rd.Value = probTarget;
}

private System.String GetString(RsRobTarget rs)
{
	ExternalAxisValues v = rs.GetExternalAxes(true);
	return System.String.Format("[[{0}, {1}, {2}], [{3}, {4}, {5}, {6}], [{7}, {8}, {9}, {10}], [{11}, {12}, {13}, {14}, {15}, {16}]]"
rs.Frame.Translation.x, rs.Frame.Translation.y, rs.Frame.Translation.z, 
rs.Frame.GlobalMatrix.Quaternion.q1, rs.Frame.GlobalMatrix.Quaternion.q2, rs.Frame.GlobalMatrix.Quaternion.q3, rs.Frame.GlobalMatrix.Quaternion.q4,  
rs.ConfigurationData.Cf1, rs.ConfigurationData.Cf4, rs.ConfigurationData.Cf6, rs.ConfigurationData.Cfx, 
v.Eax_a, v.Eax_b, v.Eax_c, v.Eax_d, v.Eax_e, v.Eax_f);
}

Comments