NVlabs / trajdata

A unified interface to many trajectory forecasting datasets.
Apache License 2.0
311 stars 38 forks source link

bug: self._trans_mean isn't initialized prior to its call #45

Open devzhxx opened 3 months ago

devzhxx commented 3 months ago

I've been using the get_value function from df_cache.py in the main branch and noticed that self._trans_mean isn't initialized prior to its call. Upon investigating further by switching to tag v1.1.0, I discovered that this function was later removed in subsequent updates.

def transform_data(self, **kwargs) -> None: if "shift_mean_to" in kwargs:

This standardizes the scene to be relative to the agent being predicted.

        self._transf_mean = kwargs["shift_mean_to"]

    if "rotate_by" in kwargs:
        # This rotates the scene so that the predicted agent's current
        # heading aligns with the x-axis.
        agent_heading: float = kwargs["rotate_by"]
        self._transf_rotmat: np.ndarray = np.array(
            [
                [np.cos(agent_heading), -np.sin(agent_heading)],
                [np.sin(agent_heading), np.cos(agent_heading)],
            ]
        )