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

interpolateVel: velocity smoother does not appear to work correctly #18

Open
gavanderhoorn opened this issue Mar 30, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@gavanderhoorn
Copy link
Member

@gavanderhoorn wrote in #16 (comment):

I'm also slightly confused how that conditional is supposed to work, as mDesc.vel is updated here:

l_mTrajPt.mDesc.vel= limit((rosTrajPtMsg.jointTrajPt.nVelocity * 100), 0, 100)

to contain a percentage (ie: int) and no longer the float we transmit in the simple message msg. The check in the motionControl task (which calls interpolateVel(..)) checks for mDesc.vel == 0.1, which can never be true if I understand things correctly.

The conditional is here:

// Smooth last point in traj
if((x_mMotion.mDesc.vel == 0.1) and (x_mMotion.nSequence != 0))
x_mMotion.mDesc.vel = (nVel[0] - (nVel[1] - nVel[0]))
endIf

As noted in the quote above: mDesc.vel isn't actually between (0, 1] here any more, but is converted to a percentage (ie: (0, 100]). As such, the condition will never be true, causing the quoted code snippet to never actually be executed.

@gavanderhoorn gavanderhoorn added the bug Something isn't working label Mar 30, 2020
@gavanderhoorn
Copy link
Member Author

@marshallpowell97: could you take a look?

Perhaps the approach taken in interpolateVel could be changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant