Skip to content

What is the approach to transfer the activity packets in posecells? #3

Description

@SeaEastXu
    %extend the Posecells one unit in each direction (max supported at the moment)
    % work out the weight contribution to the NE cell from the SW, NW, SE cells 
    % given vtrans and the direction
    % weight_sw = v * cos(th) * v * sin(th)
    % weight_se = (1 - v * cos(th)) * v * sin(th)
    % weight_nw = (1 - v * sin(th)) * v * sin(th)
    % weight_ne = 1 - weight_sw - weight_se - weight_nw
    % think in terms of NE divided into 4 rectangles with the sides
    % given by vtrans and the angle
    pca_new=zeros(PC_DIM_XY+2);            
    pca_new(2:end-1,2:end-1) = pca90;
    weight_sw = vtrans^2 *cos(dir90) * sin(dir90);
    weight_se = vtrans*sin(dir90) - vtrans^2 *cos(dir90) * sin(dir90);
    weight_nw = vtrans*cos(dir90) - vtrans^2 *cos(dir90) * sin(dir90);
    weight_ne = 1.0 - weight_sw - weight_se - weight_nw;

    % circular shift and multiple by the contributing weight
    % copy those shifted elements for the wrap around       
    pca_new = pca_new.*weight_ne + circshift(pca_new, [0 1]).*weight_nw + circshift(pca_new, [1 0]).*weight_se + circshift(pca_new, [1 1]).*weight_sw;
    pca90 = pca_new(2:end-1,2:end-1);
    pca90(2:end,1) = pca90(2:end,1) + pca_new(3:end-1,end);
    pca90(1,2:end) = pca90(1,2:end) + pca_new(end,3:end-1);
    pca90(1,1) = pca90(1,1) + pca_new(end:end);

    % unrotate the pose cell xy layer
    Posecells(:,:,dir_pc) = rot90(pca90, 4 - floor(dir * 2/pi));

I don't konw the funciton of these codes.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions