Difference between revisions of "Interaction Control Tutorial"

Jump to: navigation , search
(Impedance/Force Control Examples)
(Impedance/Force Control Examples)
Line 16: Line 16:
  
  
== start a default interaction control behavior at the endpoint ==
+
== Start a default interaction control behavior while moving to a desired configuration ==
 +
The default interaction control mode is to perform impedance control at the endpoint with maximum stiffness in all 6 directions. The following command uses <code>go_to_joint_angles_in_contact.py</code> script to move the arm from the current configuration to a specified configuration with the default interaction control behavior. Note that without any extra arguments nullspace stiffness values will also be set to the default values.
  
 
<source lang="bash">
 
<source lang="bash">
$ rosrun intera_examples go_to_joint_angles_in_contact.py
+
$ rosrun intera_examples go_to_joint_angles_in_contact.py -q 0 -0.8 0 1.6 0 0.8 0
 
</source>
 
</source>
 +
<code>-q 0 -0.8 0 1.6 0 0.8 0</code> specifies the target arm configuration. More arguments can be used to set other options (speed, interaction parameters, and etc.), which can be found by using <code>-h</code> argument for the script.
 
<br>
 
<br>
  
== apply force (30N) along z-axis of TCP frame ==
+
== Have more compliance along z-axis of TCP frame ==
 +
In impedance control, a desired stiffness value can be specified for each of 6 directions. The following command demonstrates having a low stiffness (i.e., more compliance) only along z-axis of TCP frame.
  
 
<source lang="bash">
 
<source lang="bash">
$ rosrun intera_examples set_interaction_options.py -md 1 1 2 1 1 1 -f 0 0 30 0 0 0 -ef -kn 0 0 0 0 0 0 0
+
$ rosrun intera_examples set_interaction_options.py -m 1 1 0 1 1 1 -k 1300 1300 500 30 30 30 -ef -kn 0 0 0 0 0 0 0
 
</source>
 
</source>
 +
<code>-m 1 1 0 1 1 1</code> and <code>-k 1300 1300 500 30 30 30 </code> set the direction along z-axis to have a specified stiffness of 500 while maximum stiffness values will be computed for the rest of directions. <code>-ef</code> sets TCP frame to be the reference frame for impedance control. <code>-kn 0 0 0 0 0 0 0</code> sets the nullspace stiffness to zero.
 
<br>
 
<br>
  
== having more compliance along z-axis of TCP frame ==  
+
== Apply force (30N) along z-axis of TCP frame ==
 +
Force control is usually performed only along a specific direction. The following command demonstrates how to apply force only along z-axis of TCP frame using <code>set_interaction_options.py</code> script. The endpoint remains in impedance control mode with maximum stiffness for the rest of directions. The nullspace stiffness is set to zero in this example.
  
 
<source lang="bash">
 
<source lang="bash">
$ rosrun intera_examples set_interaction_options.py -m 1 1 0 1 1 1 -k 1300 1300 500 30 30 30 -ef -kn 0 0 0 0 0 0 0
+
$ rosrun intera_examples set_interaction_options.py -md 1 1 2 1 1 1 -ef -f 0 0 30 0 0 0 -kn 0 0 0 0 0 0 0
 
</source>
 
</source>
 +
<code>-md 1 1 2 1 1 1</code> and <code>-ef</code> set the translational direction of z-axis of TCP frame to force control mode. <code>-f 0 0 30 0 0 0</code> sets the force command along z-axis to be 30N. <code>-kn 0 0 0 0 0 0 0</code> sets the nullspace stiffness to zero.
 
<br>
 
<br>
  
== impedance control with force limits (30N) along z-axis of TCP frame ==
+
 
 +
== Impedance control with force limits (30N) along z-axis of TCP frame ==
 +
As a hybrid mode between impedance and force mode, maximum force limit can be set for impedance control, which is called impedance with force limit mode. The following command demonstrates setting a force limit along z-axis of TCP frame during impedance control using this mode.
  
 
<source lang="bash">
 
<source lang="bash">
$ rosrun intera_examples set_interaction_options.py -md 1 1 3 1 1 1 -f 0 0 30 0 0 0 -ef -kn 0 0 0 0 0 0 0
+
$ rosrun intera_examples set_interaction_options.py -md 1 1 3 1 1 1 -ef -f 0 0 30 0 0 0 -kn 0 0 0 0 0 0 0
 
</source>
 
</source>
 +
<code>-md 1 1 3 1 1 1</code> and <code>-ef</code> set the translational direction along z-axis of TCP frame to be in impedance with force limit mode. <code>-f 0 0 30 0 0 0</code> sets the force limit along z-axis to be 30N. <code>-kn 0 0 0 0 0 0 0</code> sets the nullspace stiffness to zero.
 
<br>
 
<br>
  

Revision as of 21:09, 28 November 2017

This tutorial describes how to create different interaction control behaviors using example scripts.

Impedance/Force Control Examples

Interaction controller in intera enables impedance or force control at the endpoint of the arm. The following examples demonstrate using example scripts to create different interaction control behaviors.


Start a default interaction control behavior while moving to a desired configuration

The default interaction control mode is to perform impedance control at the endpoint with maximum stiffness in all 6 directions. The following command uses go_to_joint_angles_in_contact.py script to move the arm from the current configuration to a specified configuration with the default interaction control behavior. Note that without any extra arguments nullspace stiffness values will also be set to the default values.

$ rosrun intera_examples go_to_joint_angles_in_contact.py -q 0 -0.8 0 1.6 0 0.8 0

-q 0 -0.8 0 1.6 0 0.8 0 specifies the target arm configuration. More arguments can be used to set other options (speed, interaction parameters, and etc.), which can be found by using -h argument for the script.

Have more compliance along z-axis of TCP frame

In impedance control, a desired stiffness value can be specified for each of 6 directions. The following command demonstrates having a low stiffness (i.e., more compliance) only along z-axis of TCP frame.

$ rosrun intera_examples set_interaction_options.py -m 1 1 0 1 1 1 -k 1300 1300 500 30 30 30 -ef -kn 0 0 0 0 0 0 0

-m 1 1 0 1 1 1 and -k 1300 1300 500 30 30 30 set the direction along z-axis to have a specified stiffness of 500 while maximum stiffness values will be computed for the rest of directions. -ef sets TCP frame to be the reference frame for impedance control. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.

Apply force (30N) along z-axis of TCP frame

Force control is usually performed only along a specific direction. The following command demonstrates how to apply force only along z-axis of TCP frame using set_interaction_options.py script. The endpoint remains in impedance control mode with maximum stiffness for the rest of directions. The nullspace stiffness is set to zero in this example.

$ rosrun intera_examples set_interaction_options.py -md 1 1 2 1 1 1 -ef -f 0 0 30 0 0 0 -kn 0 0 0 0 0 0 0

-md 1 1 2 1 1 1 and -ef set the translational direction of z-axis of TCP frame to force control mode. -f 0 0 30 0 0 0 sets the force command along z-axis to be 30N. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.


Impedance control with force limits (30N) along z-axis of TCP frame

As a hybrid mode between impedance and force mode, maximum force limit can be set for impedance control, which is called impedance with force limit mode. The following command demonstrates setting a force limit along z-axis of TCP frame during impedance control using this mode.

$ rosrun intera_examples set_interaction_options.py -md 1 1 3 1 1 1 -ef -f 0 0 30 0 0 0 -kn 0 0 0 0 0 0 0

-md 1 1 3 1 1 1 and -ef set the translational direction along z-axis of TCP frame to be in impedance with force limit mode. -f 0 0 30 0 0 0 sets the force limit along z-axis to be 30N. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.

Constrained Zero-G Examples

The regular zero-G mode of Sawyer can be interpreted as having zero stiffnesses at the endpoint as well as nullspace, which means that the endpoint and nullspace are free to move in all directions. The constrained zero-G mode is defined by having only part of stiffness values set to zero. In this mode, the movement along/about the directions with non-zero stiffness values is constrained while the arm is free to move in the directions with zero stiffness. The following examples demonstrate how to use constrained_zeroG.py script to generate different constrained zero-G behaviors.


constrained zero-G in position

$ rosrun intera_examples constrained_zeroG.py -p


constrained zero-G in position along z-axis of base frame

$ rosrun intera_examples constrained_zeroG.py -pz


constrained zero-G in orientation

$ rosrun intera_examples constrained_zeroG.py -o


constrained zero-G in orientation about x-axis of base frame

$ rosrun intera_examples constrained_zeroG.py -ox


constrained zero-G in horizontal plane (XY)

$ rosrun intera_examples constrained_zeroG.py -ph


constrained zero-G in the nullspace

$ rosrun intera_examples constrained_zeroG.py -ns