[Documentation] [TitleIndex] [WordIndex

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Using NetFT plugin with pr2_etherCAT

Description: Configuring and using NetFT plugin with pr2_etherCAT

Keywords: NetFT, force-torque, ethercat_hardware

Tutorial Level: INTERMEDIATE

/!\ These instructions only apply to the alpha prototypes of the Force-Torque sensors that needed an external NetFT conversion box. PR2 with the force-torque sensors integrated into the grippers should follow the WG035 instructions instead.

Introduction

NetFT plugin allows force-torque data from NetFT sensor to be used by realtime controllers at 1000Hz rate. The plugin depends on new feature of pr2_ethercat_drivers from truck. Unfortunately this feature is not yet released, so an overlay of pr2_ethercat_drivers and pr2_etherCAT need to be used.

Getting Started

The best way to get started is to first go through the tutorial on running the NetFT node.

Getting overlay (ROS diamondback only)

New in Electric For ROS Electric no overlay is needed, skip the following steps.

The loading non-EtherCAT devices as realtime_loop plugins is not supported in ROS diamondback. So an overlay for pr2_robot and pr2_ethercat_drivers is needed.

Get ROS diamondback with pr2 specific packages.

sudo apt-get install ros-unstable-pr2

Create netft.rosinstall file with following information:

Then use rosinstall to create overlay in ~/netft

Source new setup script and try locating netft stack.

Make sure netft stack is found:

You should see something like

Also make sure new overlay of pr2_ethercat_drivers is found in right place:

You should see something like:

Compile:

non_ethercat_devices

Since NetFT is not an EtherCAT device, you must explicitly tell pr2_etherCAT to load netft_ethercat_hardware by using rosparams. For each non-ethercat device you want to add an element to the rosparam /pr2_etherCAT/non_ethercat_devices The element name can be anything however it is best if the name is descriptive. The element should also have a number of attributes:

There is an example roslaunch file (netft_ethercat_hardware/example.launch) that you can use as a reference for setting up the correct ROS parameters.

example.launch

Next ROS release (currently unstable)

In the next ROS release, the type is changing from NetFT to netft_ethercat_hardware/NetFT.

<launch>
  <group ns="pr2_etherCAT/non_ethercat_devices">
    <rosparam>
      netft1:
        type: netft_ethercat_hardware/NetFT    
        address: 192.168.1.1
        analog_in_name: force_torque_1
        ros_publish_period: 0.01
    </rosparam>
  </group>
</launch>

Using older Wrench instead of WrenchStamped

In next ROS release (and unstable), the normal geometry_msgs::Wrench is being replaced by geometery_msg::WrenchStamped. However, the Wrench message type can still be used by adding publish_wrench: True to the rosparams.

<launch>
  <group ns="pr2_etherCAT/non_ethercat_devices">
    <rosparam>
      netft1:
        type: NetFT    
        address: 192.168.1.1
        analog_in_name: force_torque_1
        ros_publish_period: 0.01
        publish_wrench: True
    </rosparam>
  </group>
</launch>

Running NetFT plugin with PR2

For NetFT to load, you will need to have non_ethercat_devices defined before running pr2_etherCAT.

Make new file called pr2-netft.launch with the following text:

Launch the robot

Use pr2_dashboard use view robot diagnostics. Look for "NetFT RDT Driver" entry under "Other" section.

Using data in realtime controllers

The netft_example_controllers package contains tutorials on writing and running a controller that uses data from this plugin.


2019-11-09 12:59