Skip to content

How to use iCub velocity control #333

Answered by pattacini
guiolpei asked this question in Q&A
Discussion options

You must be logged in to vote

Yep, the diagram is correct 👍

In the following piece of your main

iCubRightArmCtrl->velocityMove(3, 5.0);
iCubRightArmCtrl->velocityMove(3, 0);

you're basically commading a movement in velocity and soon afterward you stop it.

A typical velocity control loop resembles these snippets instead:

  1. To drive the joint toward setpoint:
    while (abs(error)>threshold) {
        error=setpoint-feedback;
        double velocity=Kp*error;
        ivelocity->velocityMove(joint,velocity);
        yarp::os::Time::delay(0.01);    // just some way to enforce the control rate
    }
  2. To make the joint move at constant speed for T seconds:
    double t0=yarp::os::Time::now();
    while (yarp::os::Time::now()-t0<T) {
        ivelocity->velocity…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@hamaduddin
Comment options

@pattacini
Comment options

@hamaduddin
Comment options

Answer selected by pattacini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #333 on December 08, 2020 16:53.