Has the method Body.CenterOfGravity changed?
I have a tool that creates a frame at the center of a body object and was working fine until I updated the dlls to the latest SDK version.
Below is the code I use to create a frame at the bodys COG but now I've updated the dlls it places this frame relative to world not the part or body as was before. Also see the image, the frame named center of gravity is where the latest dll is putting the frame, the frame called frame1 is where the older version puts the frame (using the same code)
If anyone can provide some guidance on this it would be much appreciated.
Below is the code I use to create a frame at the bodys COG but now I've updated the dlls it places this frame relative to world not the part or body as was before. Also see the image, the frame named center of gravity is where the latest dll is putting the frame, the frame called frame1 is where the older version puts the frame (using the same code)
private Frame GetTheMiddleOfTheBox(Body box, double offset)
{
Frame frame = new Frame();
frame.Name = "CenterOfGravity";
frame.Transform.X = box.CenterOfGravity.x /*+ (offset / 2)*/;
frame.Transform.Y = box.CenterOfGravity.y;
frame.Transform.Z = box.CenterOfGravity.z;
return frame;
}
If anyone can provide some guidance on this it would be much appreciated.
Tagged:
0
Comments
-
As far as I can tell CenterOfGravity is relative to the Body's origin and that has not changed.
To get the global position useVector3 globalCog = box.Transform.GlobalMatrix.MultiplyPoint(box.CenterOfGravity);
Johannes Weiman
Software Engineer
RobotStudio Team, ABB Robotics0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings