Difference between revisions of "Interaction Control Tutorial"

Jump to: navigation , search
(Constrained Zero-G Examples)
(Constrained Zero-G Examples)
 
(7 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
</div>
 
</div>
  
{{TOClimit|limit=2}}
+
{{TOClimit|limit=3}}
  
 
<div class="content-block">
 
<div class="content-block">
Line 12: Line 12:
 
= Impedance/Force Control Examples =
 
= Impedance/Force Control Examples =
  
[http://sdk.rethinkrobotics.com/intera/Arm_Control_Systems#Interaction_Control_Mode 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.  
+
''' New in Intera SDK 5.2! '''
 +
 
 +
[http://sdk.rethinkrobotics.com/intera/Arm_Control_Systems#Interaction_Control_Mode Interaction controller in intera] enables impedance or force control at the endpoint of the arm. The following tutorial demonstrates using example scripts to create different interaction control behaviors.  
 +
 
 +
[[File:SawyerComplianceAlongZ_small.gif|frame|left|An impedance control example with low stiffness along vertical direction.]]
 
<br>
 
<br>
  
 
+
== Default Interaction Control Motion ==  
== Start a default interaction control behavior while moving to a desired configuration ==  
+
The default interaction control mode performs impedance control at the endpoint with maximum stiffness in all 6 directions. The following command uses [https://github.com/RethinkRobotics/intera_sdk/blob/development/intera_examples/scripts/go_to_joint_angles_in_contact.py 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. A trajectory message along with interaction parameters is sent to Motion Controller. Note that without any extra arguments nullspace stiffness values, default values are used.  
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 -q 0 -0.8 0 1.6 0 0.8 0
 
$ 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.
+
<code>-q 0 -0.8 0 1.6 0 0.8 0</code> specifies the target arm joint angles. 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>
  
  
== Have more compliance along z-axis of TCP frame ==  
+
== Z-axis Compliance in the End Effector 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.
+
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 end effector (TCP) frame.
  
 
<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 -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.  
+
<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 end effector 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>
  
  
== Apply force (30N) along z-axis of TCP frame ==
+
== Z-axis Force in the End Effector 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.
+
Force control is usually performed only along a single direction. The following command demonstrates how to apply force only along the z-axis of end effector frame using the [https://github.com/RethinkRobotics/intera_sdk/blob/development/intera_examples/scripts/set_interaction_options.py set_interaction_options.py] script. This script sends a Interaction Control command directly to the realtime loop; this sets the arm into interaction control mode but does not command the arm to move. 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 -md 1 1 2 1 1 1 -ef -f 0 0 30 0 0 0 -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.  
+
<code>-md 1 1 2 1 1 1</code> and <code>-ef</code> set the translational direction of end effector's z-axis to force control mode. <code>-f 0 0 30 0 0 0</code> sets the force command along z-axis to be 30 Newtons. <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 ==
+
== Z-axis Impedance Control with Force Limits in the End Effector 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.  
+
As a hybrid mode between impedance and force mode, there is Impedance Control with Force Limit mode. The following command demonstrates setting a force limit along the end effector's z-axis during impedance control.  
  
 
<source lang="bash">
 
<source lang="bash">
 
$ 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
 
$ 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.  
+
<code>-md 1 1 3 1 1 1</code> and <code>-ef</code> set the translational direction along z-axis of end effector frame to be in impedance with force limit mode. <code>-f 0 0 30 0 0 0</code> sets the force limit along the z-axis to be 30 Newtons. <code>-kn 0 0 0 0 0 0 0</code> sets the nullspace stiffness to zero.  
 
<br>
 
<br>
  
Line 61: Line 64:
 
= Constrained Zero-G Examples =  
 
= 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 <code>constrained_zeroG.py</code> script to generate different constrained zero-G behaviors. Note that the script sets the nullspace stiffness values to default values for maintaining the elbow position, by default.
+
Regular zero-g mode of Sawyer can be interpreted as having zero stiffness at the endpoint and in the nullspace allowing the endpoint and nullspace free movement in all directions. Constrained zero-g mode only sets part of the stiffness values set to zero. In this mode, the movement about 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 [https://github.com/RethinkRobotics/intera_sdk/blob/development/intera_examples/scripts/constrained_zeroG.py constrained_zeroG.py] script to generate different constrained zero-G behaviors. Note that the script sets the nullspace stiffness values to default values for maintaining the elbow position, by default.
 +
 
 +
[[File:SawyerConstrainedZeroG_orientation_small.gif|frame|left|A constrained zero-G example with free orientation.]]
  
<br>
 
  
  
== constrained zero-G in position ==
+
== Constrained Zero-G in Position ==
 
The following command sets the endpoint to move freely only in the translational directions. In the rest of the directions (i.e., rotational directions), the endpoint remains in impedance control with maximum stiffness.  
 
The following command sets the endpoint to move freely only in the translational directions. In the rest of the directions (i.e., rotational directions), the endpoint remains in impedance control with maximum stiffness.  
 
<source lang="bash">
 
<source lang="bash">
Line 72: Line 76:
 
</source>
 
</source>
 
<code>-p</code> sets the stiffness gains for all three translational directions to 0.
 
<code>-p</code> sets the stiffness gains for all three translational directions to 0.
<br>
 
  
  
== constrained zero-G in position along z-axis of base frame ==
+
== Constrained Zero-G in Position along Base Frame Z-axis ==
The following command sets the endpoint to move freely only along z-axis of base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
+
The following command sets the endpoint to move freely only along z-axis of the base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
  
 
<source lang="bash">
 
<source lang="bash">
Line 82: Line 85:
 
</source>
 
</source>
 
<code>-pz</code> sets the stiffness gain for the translational direction along z-axis to 0.
 
<code>-pz</code> sets the stiffness gain for the translational direction along z-axis to 0.
<br>
 
  
  
== constrained zero-G in orientation ==  
+
== Constrained Zero-G in Orientation ==  
 
The following command sets the endpoint to move freely only about the rotational directions. In the rest of the directions (i.e., translational directions), the endpoint remains in impedance control with maximum stiffness.  
 
The following command sets the endpoint to move freely only about the rotational directions. In the rest of the directions (i.e., translational directions), the endpoint remains in impedance control with maximum stiffness.  
  
Line 92: Line 94:
 
</source>
 
</source>
 
<code>-o</code> sets the stiffness gains for all three rotational directions to 0.
 
<code>-o</code> sets the stiffness gains for all three rotational directions to 0.
<br>
 
  
  
== constrained zero-G in orientation about x-axis of base frame ==
+
== Constrained Zero-G in Orientation about Base Frame X-axis ==
The following command sets the endpoint to move freely only about x-axis of base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
+
The following command sets the endpoint to move freely only about x-axis of the base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
 
<source lang="bash">
 
<source lang="bash">
 
$ rosrun intera_examples constrained_zeroG.py -ox
 
$ rosrun intera_examples constrained_zeroG.py -ox
 
</source>
 
</source>
 
<code>-ox</code> sets the stiffness gain for the rotational direction about x-axis of base frame to 0.
 
<code>-ox</code> sets the stiffness gain for the rotational direction about x-axis of base frame to 0.
<br>
 
  
  
== constrained zero-G in horizontal plane (XY) ==
+
== Constrained Zero-G in Horizontal Plane (XY) ==
The following command sets the endpoint to move freely only on XY plane of base frame (i.e., along both x and y axes). In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
+
The following command sets the endpoint to move freely only on XY plane of the base frame (i.e., along both x and y axes). In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.  
 
<source lang="bash">
 
<source lang="bash">
 
$ rosrun intera_examples constrained_zeroG.py -ph
 
$ rosrun intera_examples constrained_zeroG.py -ph
 
</source>
 
</source>
 
<code>-ph</code> sets the stiffness gain for the horizontal directions (x and y axes) to be 0. Alternatively, <code>-x -y</code> can be used.  
 
<code>-ph</code> sets the stiffness gain for the horizontal directions (x and y axes) to be 0. Alternatively, <code>-x -y</code> can be used.  
<br>
 
  
  
== constrained zero-G in the nullspace ==
+
== Constrained Zero-G in the Nullspace ==
 
The following command sets the arm to move freely only in the nullspace while the endpoint remains in impedance control with maximum stiffness.  
 
The following command sets the arm to move freely only in the nullspace while the endpoint remains in impedance control with maximum stiffness.  
 
<source lang="bash">
 
<source lang="bash">
Line 119: Line 118:
 
</source>
 
</source>
 
<code>-ns</code> sets all of the nullspace stiffness gains to 0.
 
<code>-ns</code> sets all of the nullspace stiffness gains to 0.
<br>
 
  
  
  
 
</div>
 
</div>

Latest revision as of 16:52, 1 December 2017

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

Impedance/Force Control Examples

New in Intera SDK 5.2!

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

An impedance control example with low stiffness along vertical direction.


Default Interaction Control Motion

The default interaction control mode performs 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. A trajectory message along with interaction parameters is sent to Motion Controller. Note that without any extra arguments nullspace stiffness values, default values are used.

$ 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 joint angles. 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.


Z-axis Compliance in the End Effector 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 end effector (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 end effector frame to be the reference frame for impedance control. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.


Z-axis Force in the End Effector Frame

Force control is usually performed only along a single direction. The following command demonstrates how to apply force only along the z-axis of end effector frame using the set_interaction_options.py script. This script sends a Interaction Control command directly to the realtime loop; this sets the arm into interaction control mode but does not command the arm to move. 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 end effector's z-axis to force control mode. -f 0 0 30 0 0 0 sets the force command along z-axis to be 30 Newtons. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.


Z-axis Impedance Control with Force Limits in the End Effector Frame

As a hybrid mode between impedance and force mode, there is Impedance Control with Force Limit mode. The following command demonstrates setting a force limit along the end effector's z-axis during impedance control.

$ 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 end effector frame to be in impedance with force limit mode. -f 0 0 30 0 0 0 sets the force limit along the z-axis to be 30 Newtons. -kn 0 0 0 0 0 0 0 sets the nullspace stiffness to zero.

Constrained Zero-G Examples

Regular zero-g mode of Sawyer can be interpreted as having zero stiffness at the endpoint and in the nullspace allowing the endpoint and nullspace free movement in all directions. Constrained zero-g mode only sets part of the stiffness values set to zero. In this mode, the movement about 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. Note that the script sets the nullspace stiffness values to default values for maintaining the elbow position, by default.

A constrained zero-G example with free orientation.


Constrained Zero-G in Position

The following command sets the endpoint to move freely only in the translational directions. In the rest of the directions (i.e., rotational directions), the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -p

-p sets the stiffness gains for all three translational directions to 0.


Constrained Zero-G in Position along Base Frame Z-axis

The following command sets the endpoint to move freely only along z-axis of the base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -pz

-pz sets the stiffness gain for the translational direction along z-axis to 0.


Constrained Zero-G in Orientation

The following command sets the endpoint to move freely only about the rotational directions. In the rest of the directions (i.e., translational directions), the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -o

-o sets the stiffness gains for all three rotational directions to 0.


Constrained Zero-G in Orientation about Base Frame X-axis

The following command sets the endpoint to move freely only about x-axis of the base frame. In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -ox

-ox sets the stiffness gain for the rotational direction about x-axis of base frame to 0.


Constrained Zero-G in Horizontal Plane (XY)

The following command sets the endpoint to move freely only on XY plane of the base frame (i.e., along both x and y axes). In the rest of the directions, the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -ph

-ph sets the stiffness gain for the horizontal directions (x and y axes) to be 0. Alternatively, -x -y can be used.


Constrained Zero-G in the Nullspace

The following command sets the arm to move freely only in the nullspace while the endpoint remains in impedance control with maximum stiffness.

$ rosrun intera_examples constrained_zeroG.py -ns

-ns sets all of the nullspace stiffness gains to 0.