Specifying a float for trajectory t does not work
Summary
Specifying a float for the t
parameter of a trajectory leads to an index error.
Steps to reproduce
with np 1.23.1 (might not happen with older versions, I am not sure)
from timor.utilities.trajectory import Trajectory
import numpy as np
q = np.random.rand(100)
t = .1
traj = Trajectory(t, q)
if self.is_timed and self.q.shape[0] != self.t.shape[0]:
IndexError: tuple index out of range
What is the current bug behavior?
Float t
is cast to array where t.shape ==> ()
, so indexing the shape of t automatically leads to this error.
What is the expected correct behavior? // Possible Fix
Probably t should be cast to an array with shape (1,) instead.
/cc @ga59peh