Verified Commit 0eb790f4 authored by Nicolas Torres's avatar Nicolas Torres Committed by Justin Carpentier
Browse files

revert formatting in build-reduced-model.py

parent aa2ee503
......@@ -180,11 +180,11 @@ class RobotWrapper(object):
reference_configuration=None):
"""
Reduced the robot model given a list of joints to lock.
Parameters:\n
\tlist_of_joints_to_lock: list of joint indexes/names to lock\n
Parameters:
\tlist_of_joints_to_lock: list of joint indexes/names to lock.
\treference_configuration: reference configuration to compute the
placement of the lock joints.\n
If not provided, reference_configuration defaults to the robot's neutral configuration.
placement of the lock joints. If not provided, reference_configuration
defaults to the robot's neutral configuration.
NOTE: This operation is not reversible, the original model is lost.
"""
......
......@@ -12,8 +12,7 @@ model_path = pinocchio_model_dir + '/example-robot-data/robots'
mesh_dir = pinocchio_model_dir
# You should change here to set up your own URDF file
urdf_filename = model_path + '/ur_description/urdf/ur5_robot.urdf'
model, collision_model, visual_model = pin.buildModelsFromUrdf(
urdf_filename, mesh_dir)
model, collision_model, visual_model = pin.buildModelsFromUrdf(urdf_filename, mesh_dir)
# Check dimensions of the original model
print('standard model: dim=' + str(len(model.joints)))
......@@ -33,18 +32,11 @@ for jn in jointsToLock:
print('Warning: joint ' + str(jn) + ' does not belong to the model!')
# Set initial position of both fixed and revoulte joints
initialJointConfig = np.array([
0,
0,
0, # shoulder and elbow
1,
1,
1
]) # gripper)
initialJointConfig = np.array([0,0,0, # shoulder and elbow
1,1,1]) # gripper)
# Option 1: Only build the reduced model in case no display needed:
model_reduced = pin.buildReducedModel(model, jointsToLockIDs,
initialJointConfig)
model_reduced = pin.buildReducedModel(model, jointsToLockIDs, initialJointConfig)
# Option 2: Build the reduced model including the geometric model for proper displaying of the robot
model_reduced, visual_model_reduced = pin.buildReducedModel(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment