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

Driver skips points in between trajectory #32

Closed
gonzalocasas opened this issue May 5, 2019 · 7 comments
Closed

Driver skips points in between trajectory #32

gonzalocasas opened this issue May 5, 2019 · 7 comments

Comments

@gonzalocasas
Copy link
Contributor

gonzalocasas commented May 5, 2019

The motion control task of the driver skips trajectory points when they match the current configuration.

Isn't there a missing check to ensure this only happens for the first point of a trajectory?
At least, that seems to be the condition implemented on the ABB driver (which is conceptually the same but also checks current_index == 1)

Edit:
The main reason why this is incorrect imo is that motion point queueing is not the same as motion execution; the driver queues up the move commands onto the robot's internal motion buffer and then continues execution. But if the motion is stalled, herej() will always return the configuration at the time the point is queued, not at execution. The simplest case that leads to incorrect execution is starting with the robot on the zero-config, with the robot on but the motion button not active (paused motion). Then send a trajectory with 3 points: [0, 0, 90, 0, 0 ,0], [0, 0, 0, 0, 0 ,0], [0, 0, 90, 0, 0 ,0]. Upon receiving the points, the robot will skip the second point because it matches the configuration and the move that was supposed to involve 3 total moves, will actually do just one move and stop there.

@gavanderhoorn
Copy link
Member

That looks like an incorrect implementation indeed: there's no way to guarantee that herej() will be called at the right time -- most likely it will be called at the wrong time, as you note.

@nilsmelchert
Copy link
Contributor

Could this problem cause the jerky trajectories that were mentioned in #25 ?

@gonzalocasas
Copy link
Contributor Author

It does cause trajectories to execute weirdly (depending on several factors, of course). We tested generating trajectories in MoveIt and then creating val3 code out of them and that works perfectly, so I would rule out MoveIt/OMPL as the source of jerkiness.

@gavanderhoorn
Copy link
Member

@gonzalocasas: did you already check whether removing that line improves things?

Should be relatively easy to check, just comment the line.

@gonzalocasas
Copy link
Contributor Author

@gavanderhoorn yes, I confirm. Removing the line indeed fixes the issue.

@gonzalocasas
Copy link
Contributor Author

I can send a PR for it as is (just removing the line), although, I wanted to check first whether it was still meaningful to do this check but move it to the execution loop, so that it actually does what it was intended to do. But I can also send the removal-line PR for now and then send the other if I see it makes sense... What would be preferable from your perspective?

@gavanderhoorn
Copy link
Member

Let's just remove the line.

I'm not sure it makes sense to add it back somewhere else, as here() will always have a delay / be desynced with the current state of the robot.

It could be that pruning points might make sense / improve performance when very dense trajectories are streamed in. In that case here() + a margin and filtering for that could be something to consider.

I don't have any way to test that, but it could be something to keep in mind for the future.

gavanderhoorn added a commit that referenced this issue May 20, 2019
fix #32: do not skip points based on herej()
gavanderhoorn added a commit to ros-industrial/staubli_val3_driver that referenced this issue Jan 16, 2020
…iokohler/fix/point-skipping

fix ros-industrial/staubli_experimental#32: do not skip points based on herej()
gavanderhoorn pushed a commit to ros-industrial/staubli_val3_driver that referenced this issue Jan 16, 2020
…on herej()

A longer description of the problem is available on the github issue,
but the basic problem is that this is not evaluated at the correct time
(i.e. when the move is about to be executed), but at the time the move
is being queued, this means having the robot on a paused state already
triggers this problem.
gavanderhoorn added a commit to ros-industrial/staubli_val3_driver that referenced this issue Jan 16, 2020
…iokohler/fix/point-skipping

fix ros-industrial/staubli_experimental#32: do not skip points based on herej()
gavanderhoorn pushed a commit to ros-industrial/staubli_val3_driver that referenced this issue Jan 16, 2020
…on herej()

A longer description of the problem is available on the github issue,
but the basic problem is that this is not evaluated at the correct time
(i.e. when the move is about to be executed), but at the time the move
is being queued, this means having the robot on a paused state already
triggers this problem.
gavanderhoorn added a commit to ros-industrial/staubli_val3_driver that referenced this issue Jan 16, 2020
…iokohler/fix/point-skipping

fix ros-industrial/staubli_experimental#32: do not skip points based on herej()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants