Skip to content

Commit d72f4ea

Browse files
committed
unittest/python | examples : fix passing (n, 1) ndarrays for Vectors
- nanobind is less permissive
1 parent 7af3c8a commit d72f4ea

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

examples/forward-dynamics-derivatives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
model.upperPositionLimit = np.ones(model.nq)
2222

2323
q = pin.randomConfiguration(model) # joint configuration
24-
v = np.random.rand(model.nv, 1) # joint velocity
25-
tau = np.random.rand(model.nv, 1) # joint acceleration
24+
v = np.random.rand(model.nv) # joint velocity
25+
tau = np.random.rand(model.nv) # joint acceleration
2626

2727
# Evaluate the derivatives
2828

examples/inverse-dynamics-derivatives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
model.upperPositionLimit = np.ones(model.nq)
2222

2323
q = pin.randomConfiguration(model) # joint configuration
24-
v = np.random.rand(model.nv, 1) # joint velocity
25-
a = np.random.rand(model.nv, 1) # joint acceleration
24+
v = np.random.rand(model.nv) # joint velocity
25+
a = np.random.rand(model.nv) # joint acceleration
2626

2727
# Evaluate the derivatives
2828

examples/inverse-dynamics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
# Sample a random joint configuration, joint velocities and accelerations
2828
q = pin.randomConfiguration(model) # in rad for the UR5
29-
v = np.random.rand(model.nv, 1) # in rad/s for the UR5
30-
a = np.random.rand(model.nv, 1) # in rad/s² for the UR5
29+
v = np.random.rand(model.nv) # in rad/s for the UR5
30+
a = np.random.rand(model.nv) # in rad/s² for the UR5
3131

3232
# Computes the inverse dynamics (RNEA) for all the joints of the robot
3333
tau = pin.rnea(model, data, q, v, a)

unittest/python/test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ContactSolverTestCase(PinocchioTestCase):
3939
def buildStackOfCubesModel(self, masses):
4040
model = pin.Model()
4141
n_cubes = len(masses)
42-
box_dims = np.ones((3, 1))
42+
box_dims = np.ones(3)
4343
for i in range(n_cubes):
4444
box_mass = masses[i]
4545
box_inertia = pin.Inertia.FromBox(

0 commit comments

Comments
 (0)