Skip to content

Commit

Permalink
[Python] switch to numpy arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Nov 27, 2019
1 parent 556fee1 commit 2c8caa1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/example_robot_data/robots_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
from os.path import dirname, exists, join

import numpy as np

import pinocchio
from pinocchio.robot_wrapper import RobotWrapper

pinocchio.switchToNumpyArray()


def getModelPath(subpath, printmsg=False):
paths = [
Expand Down Expand Up @@ -145,7 +148,7 @@ def loadTalosLegs():
robot.visual_data = pinocchio.GeometryData(g2)

# Load SRDF file
robot.q0 = np.matrix(np.resize(robot.q0, robot.model.nq)).T
robot.q0 = np.array(np.resize(robot.q0, robot.model.nq)).T
readParamsFromSrdf(robot, modelPath + SRDF_SUBPATH, False)

assert ((m2.armature[:6] == 0.).all())
Expand Down

0 comments on commit 2c8caa1

Please sign in to comment.