Skip to content
Snippets Groups Projects
Unverified Commit e5479944 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #974 from jcarpent/devel

Minor fixes
parents 49800c0e bcf18a5d
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,8 @@ class MeshcatVisualizer(BaseVisualizer):
# Get mesh pose.
M = self.visual_data.oMg[self.visual_model.getGeometryId(visual.name)]
# Manage scaling
S = np.diag(np.concatenate((visual.meshScale,np.array([[1.0]]))).flat)
scale = np.asarray(visual.meshScale).flatten()
S = np.diag(np.concatenate((scale,[1.0])))
T = np.array(M.homogeneous).dot(S)
# Update viewer configuration.
self.viewer[self.getViewerNodeName(visual,pin.GeometryType.VISUAL)].set_transform(T)
......
......@@ -28,7 +28,7 @@ It implements the classical algorithms following the methods described in Feathe
(many thanks to him).
It also introduces efficient variations of some of them, plus some new ones, notably including a full set of algorithms to compute the derivatives of the main ones.
Pinocchio is open-source, mostly written in C++ with Python bindings, and distributed under LGPL-v3 licence.
Pinocchio is open-source, mostly written in C++ with Python bindings, and distributed under the BSD licence.
Contributions are welcome.
In this doc, you will find the usual description of the library functionalities, a quick tutorial to catch over the mathematics behind the implementation, a bunch of examples about how to implement classical applications (inverse kinematics, contact dynamics, collision detection, etc) and a set of practical exercices for beginners.
......@@ -37,6 +37,7 @@ In this doc, you will find the usual description of the library functionalities,
Pinocchio is best installed from APT packaging on Ubuntu 14.04, 16.04 and 18.04, from our repository.
On Mac OS X, we support the installation of Pinocchio through the Homebrew package manager.
If you just need the Python bindings, you can directly have access to them through Conda.
On systems for which binaries are not provided, installation from source should be straightforward.
Every release is validated in the main Linux distributions and Mac OS X.
......
from __future__ import print_function
import pinocchio as pin
pin.switchToNumpyMatrix()
from pinocchio.romeo_wrapper import RomeoWrapper
......@@ -20,12 +21,14 @@ geom_model = pin.buildGeomFromUrdf(model,urdf_model_path,model_path,pin.Geometry
# Add collisition pairs
geom_model.addAllCollisionPairs()
print("num collision pairs - initial:",len(geom_model.collisionPairs))
# Remove collision pairs listed in the SRDF file
srdf_filename = "romeo_small.srdf"
srdf_filename = "romeo.srdf"
srdf_model_path = model_path + "/romeo_description/srdf/" + srdf_filename
pin.removeCollisionPairs(model,geom_model,srdf_model_path)
print("num collision pairs - final:",len(geom_model.collisionPairs))
# Load reference configuration
pin.loadReferenceConfigurations(model,srdf_model_path)
......
......@@ -18,6 +18,13 @@ mesh_dir = model_path
urdf_model_path = str(os.path.abspath(os.path.join(model_path, 'romeo_description/urdf/romeo_small.urdf')))
model, collision_model, visual_model = pin.buildModelsFromUrdf(urdf_model_path, mesh_dir, pin.JointModelFreeFlyer())
# Currently, MeshCat is not able to retrieve the scaling from DAE files. Set it manually.
for geom in visual_model.geometryObjects:
s = geom.meshScale
s *= 0.01
geom.meshScale = s
viz = MeshcatVisualizer(model, collision_model, visual_model)
# pin.setGeometryMeshScales(visual_model,0.01)
......
......@@ -3,7 +3,7 @@ from sys import argv
from os.path import dirname, join, abspath
# This path refers to Pinocchio source code but you can define your own directory here.
pinocchio_model_dir = join(dirname(dirname(abspath(__file__))), 'models')
pinocchio_model_dir = join(dirname(dirname(str(abspath(__file__)))), "models")
# You should change here to set up your own URDF file or just pass it as an argument of this example.
urdf_filename = pinocchio_model_dir + '/others/robots/ur_description/urdf/ur5_robot.urdf' if len(argv)<2 else argv[1]
......
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