Search found 35 matches

by Ibraheem Al-Dhamari
Wed Mar 18, 2020 3:16 am
Forum: OpenSim
Topic: Iterating over the model elements
Replies: 3
Views: 156

Re: Iterating over the model elements

As I mentioned, I ma trying to add a pluginforce to the model in the cpp code as in viewtopicPhpbb.php?f=91&t=11447&p=31986&start=0&view= I already did this using rapidXML library but there was an error in windows. Now I am using the SimTK:::Xml class so no need to use external library. The code I p...
by Ibraheem Al-Dhamari
Tue Mar 17, 2020 12:12 pm
Forum: OpenSim
Topic: Iterating over the model elements
Replies: 3
Views: 156

Re: Iterating over the model elements

I couldn't find a function for this so I wrote this function: SimTK::Xml::Element findNode(SimTK::Xml::Element rootNd, std::string nodeName) { SimTK::Xml::node_iterator pnI; SimTK::Xml::Element cEl; pnI = rootNd.element_begin(); int j = 0; while ( (pnI != rootNd.element_end()) ) { cEl = pnI->getPare...
by Ibraheem Al-Dhamari
Sun Mar 15, 2020 11:41 am
Forum: OpenSim
Topic: Iterating over the model elements
Replies: 3
Views: 156

Iterating over the model elements

Dear all, I am trying to add an xml node to the model .osim file similar to this https://simtk.org/plugins/phpBB/viewtopicPhpbb.php?f=91&t=11447&p=31986&start=0&view= . RapidXML introduced NULL characters to the .osim file in windowa :evil: . I decided to try the built-in opensim XMLDocument class b...
by Ibraheem Al-Dhamari
Tue Feb 11, 2020 5:01 am
Forum: OpenSim
Topic: undefined reference error when adding a user plugin force to a model using cpp
Replies: 7
Views: 405

Re: undefined reference error when adding a user plugin force to a model using cpp

I have two related questions: for (int i=0; i<3;i++) { if (bodyCoMVelGround[i]>0) oppVelSign[i] = -1; // get opposite sign of CoM velocity (GROUND coordinate system) if (bodyCoMVelGround[i]<0) oppVelSign[i] = 1; if (bodyCoMVelGround[i]==0) oppVelSign[i] = 0; dragForceGround[i] = oppVelSign[i] * get_...
by Ibraheem Al-Dhamari
Fri Jan 31, 2020 6:36 am
Forum: OpenSim
Topic: undefined reference error when adding a user plugin force to a model using cpp
Replies: 7
Views: 405

Re: undefined reference error when adding a user plugin force to a model using cpp

Here is how I solved the issue using an extra function, probably a similar function could be added to opensim #include "rapidxml.hpp" #include "rapidxml_utils.hpp" #include "rapidxml_print.hpp" #include <boost/algorithm/string.hpp> #include <iostream> #include <string> #include <fstream> #include <s...
by Ibraheem Al-Dhamari
Thu Jan 30, 2020 1:29 pm
Forum: OpenSim
Topic: .mot in API Visualizer
Replies: 7
Views: 751

Re: .mot in API Visualizer

Thanks for the info, or that the file contains the full path name of the coordinate state variable (/ separated) while the method expects just the name, Probably this is the reason. The file are generated by the gui simulate button. When I run the code bellow I get white screen, I changed the labels...
by Ibraheem Al-Dhamari
Thu Jan 30, 2020 12:34 am
Forum: OpenSim
Topic: Lock coordinate while creating the model
Replies: 11
Views: 817

Re: Lock coordinate while creating the model

I totally missed that :lol: , thanks for your explanation.

This solves the problem!
by Ibraheem Al-Dhamari
Wed Jan 29, 2020 3:39 pm
Forum: OpenSim
Topic: .mot in API Visualizer
Replies: 7
Views: 751

Re: .mot in API Visualizer

Thanks for the information. I already tried different codes from this forum but nothing st e.g. // t loop through storage, i loop through coordinates currentCoord = inputModel.getCoordinateSet().get(i); coordName = currentCoord.getName(); stateIndex = inputMotion.getStateIndex(coordName) ; coordValu...
by Ibraheem Al-Dhamari
Wed Jan 29, 2020 3:28 pm
Forum: OpenSim
Topic: Lock coordinate while creating the model
Replies: 11
Views: 817

Re: Lock coordinate while creating the model

Thanks Thomas for the reply. I would try something like this: Coordinate& coord = rodTsphJnt->updCoordinate(); coord.setDefaultLocked(true); I don't see a difference, or am I missing something? Coordinate jntCord = rodTsphJnt->getCoordinate(); jntCord.setDefaultLocked(true); with or without the thir...