Tutorial: How to simulate Franka robot with CoppeliaSim

Table of Contents

Introduction

ViSP library allows to control the real Panda robot from Franka Emika to perform for example a position-based visual-servoing or an image-based visual-servoing. In this tutorial, we show how to simulate a Franka robot thanks to CoppeliaSim and ROS.

The simulation is a physical simulation with a model that has been accurately identified from a real Franka robot. If you are using this simulator we would appreciate that you cite this paper:

C. Gaz, M. Cognetti, A. Oliva, P. Robuffo Giordano, A. De Luca, Dynamic Identification of the Franka Emika Panda Robot With Retrieval of Feasible Parameters Using Penalty-Based Optimization. IEEE RA-L, 2019.

Install dependencies

To be able to build the package to simulate a Franka robot, you need the following dependencies

Install dependencies using rosdep

The easiest way to install these dependencies is to run rosdep following this tutorial.

Install dependencies from source

There is also the possibility to build the dependencies from source.

Build visp_ros

Install Coppeliasim

Download CoppeliaSim

Install ROSInterface for CoppeliaSim

At this point the installation depends on installed ROS version.

Examples with Franka simulator

Single Arm Visual Servoing

Here we show how to run a position-based visual-servoing (PBVS) or an image-based visual-servoing simulation (IBVS) over an 8 cm Apriltag target.

To properly run the simulator, you will need three terminals, one for roscore, one for CoppeliaSim, and one for the ROS node that does for example the visual-servo (note that roscore should be started before CoppeliaSim):

Joint Impedance Control

To run the joint impedance control example the general principle remains the same as in the previous section except that:

Cartesian Impedance Control

To run the Cartesian impedance control example the general principle remains the same as in the previous section except that:

Dual Arm Visual Servoing

We provide also a CoppeliaSim scene with 2 Franka arms. Here the show how to achieve PBVS with one arm while the other is moving an 8cm AprilTag target.

The general principle remains the same as in the previous section. The differences are that:

Examples with a real Franka robot

We provide also the material to experiment with a real Franka robot equipped with an Intel Realsense D435 RGB-D camera.

Single Arm Visual Servoing

To run a position-based visual-servoing (PBVS) over an 8 cm Apriltag target (source code available in tutorial-franka-real-pbvs-apriltag.cpp), run:

  $ cd ~/catkin_ws
  $ ./devel/lib/visp_ros/tutorial-franka-real-pbvs-apriltag --adaptive_gain --plot

After applying a user click in the window that displays images acquired by the camera, you should be able to see something similar to the following video:

Here it is interesting to notice that the source code used for simulation available in tutorial-franka-coppeliasim-pbvs-apriltag.cpp and the one used to control a real robot in tutorial-franka-real-pbvs-apriltag.cpp are similar.

To run an image-based visual-servoing (IBVS) example again on an 8 cm AprilTag target (source code available in tutorial-franka-real-ibvs-apriltag.cpp), run rather:

  $ cd ~/catkin_ws
  $ ./devel/lib/visp_ros/tutorial-franka-real-ibvs-apriltag --adaptive_gain --plot

Here also the source code used for simulation available in tutorial-franka-coppeliasim-ibvs-apriltag.cpp and the one used to control a real robot in tutorial-franka-real-ibvs-apriltag.cpp are similar.

To access advanced options, you may add --help command line option. For the IBVS (same for PBVS) example run:

  $ ./devel/lib/visp_ros/tutorial-franka-real-ibvs-apriltag --help

In particular, there is the:

Joint Impedance Control

To run a joint impedance control example on a real Franka robot (source code available in tutorial-franka-real-joint-impedance-control.cpp), you can run:

$ cd ~/catkin_ws
$ ./devel/lib/visp_ros/tutorial-franka-real-joint-impedance-control

As for the previous examples, you can see that the source code used for simulation available in tutorial-franka-coppeliasim-joint-impedance-control.cpp and the one used to control a real robot in tutorial-franka-real-joint-impedance-control.cpp are similar.



visp_ros
Author(s): Francois Pasteau, Fabien Spindler, Gatien Gaumerais, Alexander Oliva
autogenerated on Tue Mar 1 2022 00:03:22