Mini Task to Simulate a path RobotStudio
<font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">Hi,</span></font><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">It's the first time that I try to create a simulation path to move my robot in 3d robotstudio view.</div><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">My first step is to move programmatically the robot tool around in a square path. </div><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">Only an easy 3d simulation to move the robot with RS SDK code.</div><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">It's important for me because I have to make an easy 3d simulation as soon as possible.</div><div><font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">Are there some tutorial task that show how to do this? </span><span style="font-size: 13px; line-height: normal;">Does anyone help me?</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13px; line-height: normal;">Thanks in advance.</span></font><br></div>
0
Comments
-
I found something about it:(this example is using a set of RsTarget)n-->number of the elementRawPath[] path = new RawPath[n];RsPathProcedure myPath = new RsPathProcedure("myPath");RsMoveInstruction myMove = new RsMoveInstruction[n];RsTarget[] myRsTarget = new RsTarget[n];RsRobTarget[] myRobTarget = new RsRobTarget[n];mystation.ActiveTask.PathProcedures.Add(_myPath);for(int i = 0; i < n; ++i){//my function that creates a move where I passed: starting position of the path line, its orientation and an incremental indexmyMove[i] = CreateMove(newVector3(1,2,3), new Vector3(0, 180, 0), i);myPath.Instructions.Add(_myMove[i]);}RsMoveInstruction CreateMove(Vector3 position, Vector3 orientationXY, int index) {RsRobTarget robTarget = new RsRobTarget();// Set the position and rotation of theRobTarget.
robTarget.Frame.X = position.x;robTarget.Frame.Y = position.y;robTarget.Frame.Z = position.z;robTarget.Frame.RX = ABB.Robotics.Math.Globals.DegToRad(orientationXY.x);robTarget.Frame.RY = ABB.Robotics.Math.Globals.DegToRad(orientationXY.y);robTarget.Frame.RZ = ABB.Robotics.Math.Globals.DegToRad(orientationXY.z);// Add the RobTarget to the DataDeclarations of the ActiveTask.mystation.ActiveTask.DataDeclarations.Add(robTarget);// Create an RsTarget for the RobTarget, to give it a graphical representation and use it to get configs.RsTarget rsTarget = new RsTarget(_station.ActiveTask.ActiveWorkObject, robTarget);rsTarget.Name = robTarget.Name;// Add it to the ActiveTask. mystation.ActiveTask.Targets.Add(rsTarget);myRsTarget[index] = rsTarget;myRobTarget[index] = robTarget;return new RsMoveInstruction(mystation.ActiveTask,
"Move",
"Default",MotionType.Linear,mystation.ActiveTask.ActiveWorkObject.Name,robTarget.Name,mystation.ActiveTask.ActiveTool.Name);}to execute the path call this --> myPath.MoveAlong();0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings