Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create model using python & (fix) exposure of joints #53

Merged
merged 3 commits into from
Oct 21, 2015

Conversation

fvalenza
Copy link
Contributor

  • The type of joint used as a root joint can now be specified by the user in C++ and in Python
  • Add the possibility to create a model from scratch in python. To do so, first create an empty model using BuildEmptyModel(), then add one by one your joints with addBody(..args..)
  • Also fixing a missing functionality : you now have properly access to the joints of the model.

Exemple

import pinocchio as se3

from pinocchio.romeo_wrapper import RomeoWrapper

myModel = se3.Model.BuildEmptyModel()

myModel.addBody(0, se3.JointModelFreeFlyer(), se3.SE3.Random(), se3.Inertia.Random(),"j1","b1",True)
myModel.addBody(1, se3.JointModelRX(), se3.SE3.Random(), se3.Inertia.Random(),"j2","b2",True)

joint =  myModel.joints[2]
print joint.idx_q
print joint.nq

… to choose root joint when creating a model (in C++) or a robot (in Python). May be a check can be done on the value of root parameter in python if it's not None
… addBody, in python there is no default parameters
@fvalenza
Copy link
Contributor Author

@jcarpent new version of pull request.
parseTree and buildModel have been reworked to allow to be used with or without specifying a root joint. More user friendly.
Again: there are two methods in python to build a model because the macro BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS seems not be usable because of the different scopes

jcarpent added a commit that referenced this pull request Oct 21, 2015
create model using python & (fix) exposure of joints
@jcarpent jcarpent merged commit f15652e into stack-of-tasks:devel Oct 21, 2015
@jcarpent jcarpent mentioned this pull request Oct 21, 2015
@fvalenza fvalenza deleted the topic/createModelWithPython branch October 21, 2015 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants