iCub-main
velocityControl

Perform position control using a velocity control loop.

+ Collaboration diagram for velocityControl:

Perform position control using a velocity control loop.

Description

This module performs joint space position control using a velocity loop. It basically implements a pid control converting a position error into a velocity signal that sent to the control board. It allows commanding trajectories at fine temporal scale (~10-20ms).

Note: for safey reasons the module initially starts with 0 gain and 0 max velocity, so you first have to set them to correct values.

Use yarp rpc and type for example:

gain 0 10
svel 0 10

This set gain and maximum velocity to 10 for the joint 0.

There are maximum values for gain and velocity set in the code (check velControlThread.cpp). At the moment they are set to 10 and 50 deg/sec respectively.

Libraries

YARP

Parameters

–robot: specifies the name of the robot. It will be used to form the names of the ports created and accessed by module.

–part: part to control (e.g. head,arm_right, arm_left, lef_right...), it will be used to form the names of the ports created and accessed by the module.

–period: the periodicity of the velocity control loop, in milliseconds (possible values are 20 or 10).

Ports Accessed

It accesses ports created when the robot is launched.

Ports Created

The module instantiates a control_board device, which opens the usual ports. The pattern of the name is as follow:

where robot is the name of the robot as specified with –robot and part is the required part as specified with –part (see below).

Note: commands to the module through /robot/vc/part/input are not fast, use /robot/vc/part/fastCommand or /robot/vc/part/command instead.

Input Data Files

None.

Output Data Files

None.

Configuration Files

None.

Tested OS

Linux and Windows.

Example Instantiation of the Module

velocityControl –robot icub –part head –period 10

Starts the velocityControl module using the robot icub to control the head. The period of the velocity control loop will be 10ms.

Author
Lorenzo Natale

Copyright (C) 2008 RobotCub Consortium

CopyPolicy: Released under the terms of the GNU GPL v2.0.

This file can be edited at src/velocityControl/main.cpp.