Skip to content
Snippets Groups Projects
Commit d8697733 authored by jcarpent's avatar jcarpent
Browse files

[Python] Raise exception if Geometry module has not been compiled with Pinocchio

parent 9aad0bff
No related branches found
No related tags found
No related merge requests found
#
# Copyright (c) 2015 CNRS
# Copyright (c) 2015-2016 CNRS
#
# This file is part of Pinocchio
# Pinocchio is free software: you can redistribute it
......@@ -31,6 +31,20 @@ class RobotWrapper:
self.v0 = utils.zero(self.nv)
self.q0 = utils.zero(self.nq)
def __init__(self,filename, mesh_dir, root_joint = None):
if not "buildModelAndGeomFromUrdf" in dir(se3):
raise Exception('It seems that the Geometry Module has not been compiled with Pinocchio')
self.modelFileName = filename
if(root_joint is None):
self.model, self.geometry_model = se3.buildModelAndGeomFromUrdf(filename,mesh_dir)
else:
self.model, self.geometry_model = se3.buildModelAndGeomFromUrdf(filename,mesh_dir,root_joint)
self.data = self.model.createData()
self.geometry_data = se3.GeometryData(self.data, self.geometry_model)
self.v0 = utils.zero(self.nv)
self.q0 = utils.zero(self.nq)
def increment(self,q,dq):
M = se3.SE3( se3.Quaternion(q[6,0],q[3,0],q[4,0],q[5,0]).matrix(), q[:3])
dM = exp(dq[:6])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment