Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: asseme_ego_compensated not work #25

Open
blackmrb opened this issue May 18, 2024 · 1 comment
Open

bug: asseme_ego_compensated not work #25

blackmrb opened this issue May 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@blackmrb
Copy link

The default value of asseme_ego_compensated is True, but my laser point cloud does not have motion compensation, so I set asseme_ego_compensated to false.
However, asseme_ego_compensated in _generaterarys'from_points() is still true.

@dataclass
class CustomData(ADDataParser):
    .....
    .....
    def _get_lidars(self) -> Tuple[Lidars, List[Path]]:
        """Returns lidar info and loaded point clouds."""

        lidars = Lidars(
            lidar_to_worlds=poses[:, :3, :4],
            lidar_type=LidarType.VELODYNE128,
            times=times,
            assume_ego_compensated=False, # change here
            metadata={"sensor_idxs": idxs},
            horizontal_beam_divergence=HORIZONTAL_BEAM_DIVERGENCE,
            vertical_beam_divergence=VERTICAL_BEAM_DIVERGENCE,
        )

        return lidars, lidar_filenames
    def _generate_rays_from_points(
        self,
        lidar_indices: Int[Tensor, "*num_rays num_lidars_batch_dims"],
        points: Float[Tensor, "*num_points point_dim"],
        lidar_opt_to_lidar: Optional[Float[Tensor, "*num_rays 3 4"]] = None,
    ) -> RayBundle:
       .......
        if points.shape[-1] >= 5 and self.metadata and "velocities" in self.metadata:
            # Offset the point origins according to timediff and velocity
            origins = origins + points[..., 4:5] * self.metadata["velocities"][lidar_indices.squeeze(-1)]
            if not self.assume_ego_compensated: # here
                # offset the world points according to velocity too
                points_world = points_world + points[..., 4:5] * self.metadata["velocities"][lidar_indices.squeeze(-1)]

image

the callback stack is below:
image

I think it's the class Lidar base class TensorDataclass problem, but I don't konw how to fix it. I temporarily set the default value of asseme_ego_compensated to false.

@georghess georghess self-assigned this May 20, 2024
@georghess
Copy link
Owner

Good catch! It seems that when slicing a TensorDataclass it will init a new TensorDataclass with the default init params. For your application, the easiest thing will likely be to change the default. But I'll look at a more general solution

@georghess georghess added the bug Something isn't working label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants