In this problem, we will use the OpenSim API to check the solution to problem 7.3 Introduction to transformation matrices. (If you haven't completed that problem yet, please start there.)
(a) Download and install OpenSim.
(b) Read the Common Scripting Commands and Scripting in the GUI pages in the OpenSim documentation.
(c) Define frame A and point p in a model. You can do this by writing a script that creates a new model, or you could add components to an existing model. For simplicity, the instructions here will add components to the arm26 model. First, open arm26.osim. Next, type the following in the ScriptingShell Window, filling in the missing information as indicated:
model = getCurrentModel() sphere = modeling.Sphere(0.02) transA = modeling.Transform( modeling.Vec3(a,b,c) ) #fill in a,b,c frameA = modeling.PhysicalOffsetFrame(model.getGround(), transA) frameA.setName('frameA') model.addComponent(frameA) frameA.attachGeometry(sphere) m = modeling.Marker('p', frameA, modeling.Vec3(a,b,c) ) #fill in a,b,c model.addMarker(m) model.finalizeConnections() model.print('step1.osim')
(d) Close the arm26 model and open step1.osim. You will see a sphere at the origin of frame A and a marker at point p. Next, we will add frame B. Type the following in the ScriptingShell Window, filling in the missing information as indicated:
.