diff --git a/examples/python/load-urdf.py b/examples/python/load-urdf.py index d58b29d1090a2992e0de49516d14a7e6e881d5c1..480b4fbf474af0995626aaa43cb78a3ba2d1b02d 100755 --- a/examples/python/load-urdf.py +++ b/examples/python/load-urdf.py @@ -1,7 +1,30 @@ +## +## Copyright (c) 2018 CNRS +## +## This file is part of Pinocchio +## Pinocchio is free software: you can redistribute it +## and/or modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation, either version +## 3 of the License, or (at your option) any later version. +## +## Pinocchio is distributed in the hope that it will be +## useful, but WITHOUT ANY WARRANTY; without even the implied warranty +## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Lesser Public License for more details. You should have +## received a copy of the GNU Lesser General Public License along with +## Pinocchio If not, see +## <http:##www.gnu.org/licenses/>. +## + +## +## In this short script, we show how to a load a robot model from its URDF description. +## Here, the robot model is ROMEO, but a similar approach can be done by with rospkg. +## + import pinocchio as pin -from pinocchio.romeo_wrapper import RomeoWrapper +from pinocchio.romeo_wrapper import RobotWrapper -## Load Romeo with RomeoWrapper +# Load Romeo with RomeoWrapper import os current_path = os.getcwd() @@ -11,14 +34,15 @@ mesh_dir = model_path urdf_filename = "romeo.urdf" urdf_model_path = model_path + "/urdf/" + urdf_filename -robot = RomeoWrapper(urdf_model_path, [mesh_dir]) +robot = RobotWrapper(urdf_model_path, [mesh_dir]) -## alias +# alias model = robot.model data = robot.data -## do whatever, e.g. compute the center of mass position in the world frame +# do whatever, e.g. compute the center of mass position expressed in the world frame q0 = robot.q0 com = robot.com(q0) -# This last command is similar to + +# This last command is similar to: com2 = pin.centerOfMass(model,data,q0)