Skip to content

Commit

Permalink
clean up of cartesian and gaze interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pattacini committed Nov 26, 2022
1 parent bac8da0 commit ccce0ba
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 693 deletions.
14 changes: 7 additions & 7 deletions doc/anyrobot_cartesian_interface.dox
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ performances. Here follow the details. \n
as much as possible since a lag in the control loop will inevitably cause for instance unwanted overshoots in the
response. As final suggestion, consider placing the server physically close to the robot, that is where fast ethernet
link ends (and yarp too) and the internal robot bus begins (e.g. CAN); for iCub indeed, the server runs aboard the
PC104.
icub-head.
- The client simply lives inside the user code, making queries to the server through yarp ports, thus it never speaks
to the solver. There are no special needs for it: the location of the client depends only on the requirements of the
user code; a program that opens up a client may run on a shuffle PC so as on a powerful machine or even aboard the
Expand All @@ -50,8 +50,8 @@ performances. Here follow the details. \n

\section sec_customcart_dependencies Dependencies

Besides the "classical" dependecies you need to have in order to compile all the components (<a href="http://wiki.icub.org/wiki/Installing_IPOPT">Ipopt</a>,
\ref iKin, \ref servercartesiancontroller, \ref clientcartesiancontroller; you should know them very well by now :),
Besides the "classical" dependecies you need to have in order to compile all the components (Ipopt, yarp, icub-main,
iKin, servercartesiancontroller, clientcartesiancontroller; you should know them very well by now :),
you are required to accomplish a preliminary job: it can be tedious (I realize it when I had to write the "fake" stuff :)
but is mandatory. You have to provide some low-level yarp motor interfaces that are necessary for the cartesian components
to start and operate correctly. They are only three: <b>IControlLimits</b>, <b>IEncoders</b>, <b>IVelocityControl</b>.
Expand All @@ -65,7 +65,7 @@ Moreover, as enhanced option, the server is also capable of automatically detect
interface, through which the low-level velocity control is replaced by the faster and more accurate streaming position control.
In this latter modality, also the standard <b>IPositionControl</b> interface is required to be implemented. \n
This is not the right place where to tell about how to deal with these interfaces, but please find out more on the topic
of making a new device in yarp <a href="http://wiki.icub.org/wiki/Making_a_new_device_in_YARP">here</a>.
of <a href="https://www.yarp.it/latest/group__note__devices.html">making a new device in yarp</a>.


\section sec_customcart_custom_example Example of Customization
Expand Down Expand Up @@ -108,9 +108,9 @@ link_0 (A 1.0) (D 0.0) (alpha 0.0) (offset 0.0) (min -180.0) (max 180.0)
link_1 (A 1.0) (D 0.0) (alpha 0.0) (offset 0.0) (min -180.0) (max 180.0)
link_2 (A 1.0) (D 0.0) (alpha 0.0) (offset 0.0) (min -180.0) (max 180.0)
\endcode
The meaning of these parameters is described in the \ref iKinLink class; at any rate they are easily recognized as the link length
(<i>A</i> in [m]), the link offset (<i>D</i> in [m]), the link twist (<i>alpha</i> in [rad]) and so on: please visit the wiki
<a href="http://wiki.icub.org/wiki/ICubForwardKinematics">page</a> on kinematics for a deeper insight. \n
The meaning of these parameters is described in the iKinLink class; at any rate they are easily recognized as the link length
(<i>A</i> in [m]), the link offset (<i>D</i> in [m]), the link twist (<i>alpha</i> in [rad]) and so on: please visit the
<a href="https://icub-tech-iit.github.io/documentation/icub_kinematics/icub-forward-kinematics/icub-forward-kinematics">documentation</a> on kinematics for a deeper insight. \n
A careful reader should have not missed the expression for the joints limits, which here can definitely take whatever values for all
the three joints, much different from the bounds assigned to the real joints and hard-coded within the fake motor device.
Do not worry about that: at start-up the solver will query the low-level interface (namely <i>IControlLimits</i>) about the actual
Expand Down
37 changes: 10 additions & 27 deletions doc/cartesian_interface.dox
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@ Alternatively, the client can act as a pure wrapper over the solver coping with
meeting some specific requirements. However, also in this configuration, the server part needs to be launched (even if not employed) as a gateway to let the client
communicate with the solver.

\note A paper that describes how the controller works can be downloaded <a href="http://wiki.icub.org/images/c/cf/CartesianControllersEvaluation.pdf">here</a>.
<b>If you're going to use this controller for your work, please quote it within any resulting publication</b>: U. Pattacini, F. Nori, L. Natale, G. Metta, G. Sandini,
"An Experimental Evaluation of a Novel Minimum-Jerk Cartesian Controller for Humanoid Robots", <i>IEEE/RSJ International Conference on Intelligent Robots and Systems</i>,
Taipei, Taiwan, 2010.
\note <b>If you're going to use this controller for your work, please quote it within any resulting publication</b>:
U. Pattacini, F. Nori, L. Natale, G. Metta, G. Sandini, "An Experimental Evaluation of a Novel Minimum-Jerk Cartesian Controller for Humanoid Robots",
<i>IEEE/RSJ International Conference on Intelligent Robots and Systems</i>, Taipei, Taiwan, 2010.


\section sec_cart_dependencies Dependencies

In order to use the Cartesian Interface, make sure that the following steps are done: \n
[Note that the term <i>cluster</i> refers to the set of computers directly connected to the robot network, whereas <i>PC104</i>
[Note that the term <i>cluster</i> refers to the set of computers directly connected to the robot network, whereas <i>icub-head</i>
indicates the hub board mounted on the robot]

-# Update YARP and iCub repositories and compile them (always a good practice).
-# Install <a href="http://wiki.icub.org/wiki/Installing_IPOPT">Ipopt</a> on the cluster.
-# Install the required <a href="https://icub-tech-iit.github.io/documentation/sw_installation/">software dependencies</a>.
-# On the cluster: compile the repository with the switch <b>ENABLE_icubmod_cartesiancontrollerclient</b> enabled. This will make
the client part of the interface available.
-# On PC104: compile the repository with the switch <b>ENABLE_icubmod_cartesiancontrollerserver</b> enabled. This will make the
-# On icub-head: compile the repository with the switch <b>ENABLE_icubmod_cartesiancontrollerserver</b> enabled. This will make the
server part of the interface available on the hub.


Expand All @@ -49,7 +47,7 @@ indicates the hub board mounted on the robot]
Henceforth rely on the installed copy of <i>$ICUB_ROOT/main/app/iCubStartup/scripts/iCubStartup.xml.template</i> application
to launch both the Cartesian solvers (and other useful tools as well). \n
The \ref iKinCartesianSolver "Cartesian Solvers" are required to invert the kinematics using Ipopt and they are meant to run
on the cluster to avoid overloading the PC104 core. Make sure that the machines where the solvers will be running are configured
on the cluster to avoid overloading the icub-head core. Make sure that the machines where the solvers will be running are configured
properly to work with the specific robot (e.g. the <b>YARP_ROBOT_NAME</b> correctly points to the name of the robot) in order
to load at start-up the robot dependent kinematics. \n
The solvers need the robotInterface to connect to the robot to get useful data to operate (e.g. the joints bounds) and also the
Expand Down Expand Up @@ -101,7 +99,7 @@ Central for a correct usage of the Cartesian controller is the knowledge of the
that shall be adopted to describe any desired limb pose.

Positions (in meters) and orientation refer to the root frame attached to the waist as in the
<a href="http://wiki.icub.org/wiki/ICubForwardKinematics">wiki</a> page. \n
<a href="https://icub-tech-iit.github.io/documentation/icub_kinematics/icub-forward-kinematics/icub-forward-kinematics">documentation</a>. \n
The root <b>x-axis</b> points backward, the <b>y-axis</b> points rightward, while the <b>z-axis</b> points upward.

To specify a target orientation of the end-effector, you have to provide three components for the rotation
Expand Down Expand Up @@ -147,7 +145,7 @@ Vector o=yarp::math::dcm2axis(R);

\section sec_cart_useinterface Using the Cartesian Interface

The YARP <b>Cartesian Interface</b> is fully documented <b><a href="http://wiki.icub.org/yarpdoc/classyarp_1_1dev_1_1ICartesianControl.html">here</a></b>.
The YARP documentation contains a full description of <b><a href="https://yarp.it/latest/classyarp_1_1dev_1_1ICartesianControl.html">Cartesian Interface</a></b>.
Moreover, some examples are also reported hereafter to gain a deeper insight into the Cartesian device.

Imagine that we want to get the actual arm pose from within our code. What we have to write is just:
Expand Down Expand Up @@ -479,19 +477,4 @@ public:
}
};
\endcode


\section sec_cart_siminterface The Simulator and the Cartesian Interface

To have the Cartesian Interface fully operative together with the robot simulator, follow these steps:

-# Launch the \ref icub_Simulation "iCub Simulator".
-# Deploy the Cartesian servers: <b>yarprobotinterface \--context simCartesianControl</b>
-# Launch the \ref iKinCartesianSolver "Cartesian Solvers" for the required limbs: have a look to the template located in
the directory <i>icub-main/app/simCartesianControl/scripts</i>.

Note that you will need to compile the server part of the interface also on the cluster where the simulator is supposed to run.

A working example is available under src/motorControlAdvanced/tutorial_cartesian_interface.cpp which makes the left hand follow
a circular trajectory located in front of the simulated robot.
*/
*/
1 change: 0 additions & 1 deletion doc/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ A list of tutorials on various topics from basic compilation, visual processing,
- \ref icub_motor_control_tutorial - a tutorial on how to use the motor interfaces
- \ref icub_impedance_control_tutorial - a tutorial on how to use the joint level torque/impedance interface
- \ref icub_basic_image_processing - a tutorial on a basic image processing
- \ref icub_periodic_thread - a tutorial on how to write a control loop using threads
- \ref icub_cartesian_interface - a tutorial on how to control a robot's limb in the operational space
- \ref icub_gaze_interface - a tutorial on how to control the robot gaze through a YARP interface
Expand Down
20 changes: 4 additions & 16 deletions doc/gaze_interface.dox
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Roncone A., Pattacini U., Metta G. & Natale L., "A Cartesian 6-DoF Gaze Controll

In order to use the Gaze Interface, make sure that the following steps are done:

-# Update YARP and iCub repositories and compile them (always a good practice).
-# Install <a href="http://wiki.icub.org/wiki/Installing_IPOPT">Ipopt</a>.
-# Install the required <a href="https://icub-tech-iit.github.io/documentation/sw_installation/">software dependencies</a>.
-# Compile the iCub repository with the switch <b>ENABLE_icubmod_gazecontrollerclient</b> enabled: this will make
the client part of the interface available. The server part is represented by the module \ref iKinGazeCtrl itself.

Expand Down Expand Up @@ -70,12 +69,12 @@ clientGazeCtrl.close();

\section sec_gaze_useinterface Using the Gaze Interface

The YARP <b>Gaze Interface</b> is fully documented <b><a href="http://wiki.icub.org/yarpdoc/classyarp_1_1dev_1_1IGazeControl.html">here</a></b>.
The YARP documentation contains a full description of <b><a href="https://yarp.it/latest/classyarp_1_1dev_1_1IGazeControl.html">Gaze Interface</a></b>.
It makes use of three different coordinate systems that enable the user to control the robot's gaze as detailed hereafter.

\subsection subsec_gaze_cartcoorsystem Expressing the fixation point in Cartesian Coordinates
This coordinate system is the same as the one the \ref icub_cartesian_interface "Cartesian Interface" relies on and complies with the
<a href="http://wiki.icub.org/wiki/ICubForwardKinematics">wiki</a> specifications; it lets the user to give the target
<a href="https://icub-tech-iit.github.io/documentation/icub_kinematics/icub-forward-kinematics/icub-forward-kinematics">documentation</a>; it lets the user to give the target
location where to gaze at with respect to the root reference frame attached to the robot's waist.

The following snippet of code shows how to command the gaze in the Cartesian space and to retrieve the current configuration.
Expand Down Expand Up @@ -355,15 +354,4 @@ public:
}
};
\endcode


\section sec_gaze_siminterface The Simulator and the Gaze Interface

The Gaze Interface is already fully operative with the robot simulator: you only need to select the proper configuration file. \n
To do that, type the following:
\code
iKinGazeCtrl --from configSim.ini
\endcode

A working example is available here: src/motorControlAdvanced/tutorial_gaze_interface.cpp
*/
*/
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ include(CTest)
# go by subdirectories
add_subdirectory(imageProcessing)
add_subdirectory(motorControlBasic)
add_subdirectory(motorControlAdvanced)
add_subdirectory(motorControlImpedance)
add_subdirectory(periodicThread)
add_subdirectory(ctrlLib)
Expand Down
19 changes: 0 additions & 19 deletions src/motorControlAdvanced/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit ccce0ba

Please sign in to comment.