Closed AndyPermaRobotics closed 1 year ago
Hi Andreas,
thanks for bringing this up! You're right, the carrot move strategy doesn't work well for long splines. Because of the rather complicated nature of splines it isn't trivial to move the carrot by an exact distance. Therefore I originally chose the rather arbitrary value of 0.01 (in terms of parameter t
) and never improved upon this solution.
But as you demonstrated, we can use the spline's estimated_length
to relate the carrot distance
to the approximate spline length. You should, however, divide by something like 10 (as you suggested) to compensate for multiple aspects:
estimated_length
tends to be shorter than the true length. We therefore overestimate the step size.t
. There are sections where the distance grows slower or faster.distance
, but so far that it is farther away from the robot than the distance
. Therefore we usually want to move it less.distance
.A pull request would be very welcome. I just checked the repository settings: You should be able to post PRs. I actually don't understand why you should be lacking permissions. Maybe you can try again and, if the problem persists, provide a more detailed description of the error you're seeing? Thanks!
Hello everyone,
I noticed an issue with the rosys driver, that aborts long splines, before the robot reaches the end of the spline.
On the image, you can see, that the robot started to move to Waypoint 2, before it reached Waypoint 1.
I figured out, that the reason is, that in the Carrot.move() method the carrot is moved forward by 1% of the spline length. For very long splines this procedure leads to the behavior in the screenshot.
I would suggest to calculate a step_size for the move() Method based on the desired distance and the spline length.
Here is my code:
Even in this example the distance between hook and carrot can be quite far away from the given
distance
. Maybe it would be better to calculate the step_size like this:step_size = distance / self.estimated_length / 10
.I could not create a pull request, because of missing permissions, therefore I created this issue.
Best regards Andreas