Skip to content

Question about rotation_angle when rotating prev_bev #310

Description

@whystopped

if prev_bev is not None:
if prev_bev.shape[1] == bev_h * bev_w:
prev_bev = prev_bev.permute(1, 0, 2)
if self.rotate_prev_bev:
for i in range(bs):
# num_prev_bev = prev_bev.size(1)
rotation_angle = kwargs['img_metas'][i]['can_bus'][-1]
tmp_prev_bev = prev_bev[:, i].reshape(
bev_h, bev_w, -1).permute(2, 0, 1)
tmp_prev_bev = rotate(tmp_prev_bev, rotation_angle,
center=self.rotate_center)
tmp_prev_bev = tmp_prev_bev.permute(1, 2, 0).reshape(
bev_h * bev_w, 1, -1)
prev_bev[:, i] = tmp_prev_bev[:, 0]

metas_map[i]['can_bus'][-1] -= prev_angle

According to the codes above, the rotation_angle used to rotate prev_bev is the difference between two patch angles, which is now_angle - prev_angle.

However, as shown in the following figure, if we want to align prev_bev (in yellow color) to the current frame (in black color), we are actually rotate the black rectangle (prev_bev in the previous frame coordinate) to the yellow rectangle (prev_bev in the current frame coordinate).

So my question is, the rotation_angle used to rotate prev_bev should be prev_angle - now_angle, rather than now_angle - prev_angle used in the code above, is that right?

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions