-
Rayat Goyal posted the following question. I am using the icart->goToPoseSync(xd,od);
icart->waitMotionDone(); I have now several 3D points, e.g:
that I am providing to the Cartesian controller within a loop. What happens is that the hand moves towards the first point and then comes to a stop, starts again and moves to the second point and so on so forth.
Any idea on how to achieve smooth motion using the |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
@stephane-lallee replied: I might be wrong, but I guess you have to calculate the waypoints yourself so that they form a "smooth trajectory". If you send to the controller some jerky trajectory then it will be jerky. Let's assume you have 4 points which form a rectangle, then the hand effector will move more or less along the sides of this triangle. If instead you want the hand to pass by all the corners but describing a circle then you have to calculate manually some additional waypoints... Although I may not have understood completely your issue. |
Beta Was this translation helpful? Give feedback.
-
Rayat Goyal replied: The problem I am having is I want the arm to keep moving and not to stop on the points in between. I think I used the word "smooth" wrong in the context. |
Beta Was this translation helpful? Give feedback.
-
My suggestion is to provide the For instance, the rectangle has 4 edges, hence there will be 4 different states of the thread; in each state the path law is linear with a constant velocity. Once one state is complete, then you immediately switch to the next state without letting the controller stop. The instant position of that virtual point should be passed to the controller in streaming, i.e. with the Basically, the example in the tutorial with the circular trajectory already gives you a code template to stick to. |
Beta Was this translation helpful? Give feedback.
-
Rayat Goyal replied: That is a nice solution, but the problem is I don't have the trajectory points beforehand. What I am doing is waiting until the trajectory is 70% complete and then providing the second point, so that the arm does not lose the velocity and continues towards the new target. Here is the code logic behind the code: virtual void cartesianEventCallback()
{
goahead=true;
}
public:
CtrlThread(const double period) : RateThread(int(period*1000.0))
{
// raise at event at 70% of trajectory .
cartesianEventParameters.type="motion-ongoing";
cartesianEventParameters.motionOngoingCheckPoint=0.7;
}
//...
while (//new data point given every-time in this loop )
{
icart->goToPose(xd,od);
goahead=false;
std::cout<<"waiting";
while (goahead==false)
std::cout<<".";
} Any idea why this is not working, or any other alternative solutions? |
Beta Was this translation helpful? Give feedback.
-
The technique I proposed is still viable in a dynamic fashion. Assume that your input is received with a period What the thread should accomplish is the following:
Of course, the final movement won’t stop and will appear to be smooth enough if and only if:
So, as you can figure out, there are three dynamics you need to blend and trade off:
Normally (1) is given and you can play with (2) and (3) relying on the parameters Coming to the use of the callback, you have to bear in mind that the point-to-point movement is designed in such a way that the end-effector will follow a quasi-minimum-jerk trajectory in the operational space meaning that the velocity profile is bell-shaped and approaches zero in the neighborhood of the end of the set-point. Depending on the values assumed by However, what you will get is simply a sequence of bells (representing the velocity) that are joint together exactly at the 70% of their profile. This necessarily entails an overall stick-slip movement. One further solution you can explore makes use of the cartesian velocities. In principle you should be able – up to a certain extent – to set directly the speed (translational + rotational) of the end-effector in the operational space. The relevant method is |
Beta Was this translation helpful? Give feedback.
The technique I proposed is still viable in a dynamic fashion.
Assume that your input is received with a period
P_i
; this means that eachP_i
seconds you get a fresh new pointx(i)
.What the thread should accomplish is the following:
P_j
(< P_i
) it generates a virtual (temporary) targettg(j)
that is spatially (linearly) comprised betweenx(i-1)
andx(i)
and moves fromx(i-1)
tox(i)
with a given constant speedvel
.tg(j)
to the Cartesian controller which has been tuned with a properTtraj
point-to-point maneuver time.Of course, the final movement won’t stop and will appear to be smooth enough if and only if:
x(i+1)
is provided well be…