- Install system dependencies
1.1. Install Ubuntu requested packages
1.2. Install Iit Butterworth Filter
1.3. Install ViSP - Install ROS dependencies
2.1. Install ROS melodic
2.2. Install vision_visp package
2.3. Install visp_ros package
2.4. Install visp_ros_coppeliasim package - Install CoppeliaSim
3.1. Download CoppeliaSim
3.2. Build ROSInterface for CoppeliaSim - Run the Franka simulator
-
Update Ubuntu packages
$ sudo apt-get update $ sudo apt-get upgrade
-
Install requested 3rd parties for ViSP
$ sudo apt-get install libopencv-dev libx11-dev liblapack-dev libeigen3-dev \ libv4l-dev libzbar-dev libpthread-stubs0-dev libjpeg-dev \ libpng-dev libdc1394-dev libpcl-dev
-
Install Orocos-kdl needed for inverse and direct robot arm kinematics computation
$ sudo apt-get install liborocos-kdl-dev
Back to summary.
This filter is needed if data from CoppeliaSim to ROS is noisy. The source code is available here.
To proceed to the installation run:
$ sudo add-apt-repository ppa:berndporr/dsp
$ sudo apt install iir1 iir1-dev
Back to summary.
ViSP last release is packaged for ROS, but at the time this tutorial was written, not for melodic
distro. Moreover, ViSP last release is not packaged for Ubuntu 18.04.
That's why you have to install VISP from source, following the instructions listed here.
We resume hereafter these instructions:
-
Get ViSP source code
$ mkdir -p ~/software/visp $ cd ~/software/visp $ git clone https://github.com/lagadic/visp.git
-
Create a build forder
$ mkdir -p visp-build
-
Execute cmake to configure ViSP
$ cd visp-build $ cmake ../visp
-
Compile ViSP
$ make -j4
Back to summary.
For Ubuntu 18.04, the native version of ROS is melodic. A tutorial on how to easily install ROS melodic on Ubuntu can be found here. Be sure to complete also the first tutorial in order to create a ROS catkin workspace.
At this point we assume that your workspace is in ~/catkin_ws
.
Back to summary.
From this metapackage we need visp_bridge
package in order to be able to build visp_ros
as described in the next section. To install this package:
-
Clone
vision_visp
package in the cartkin workspace, and switch tomelodic
branch$ cd ~/catkin_ws/src $ git clone https://github.com/lagadic/vision_visp.git --branch melodic
-
Build package
$ source /opt/ros/melodic/setup.bash $ cd ~/catkin_ws/ $ catkin_make --cmake-args -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=~/software/visp/visp-build
Back to summary.
-
Clone
visp_ros
package in the cartkin workspace$ cd ~/catkin_ws/src $ git clone https://github.com/lagadic/visp_ros.git
-
Build package
$ source /opt/ros/melodic/setup.bash $ cd ~/catkin_ws/ $ catkin_make --cmake-args -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=~/software/visp/visp-build
Back to summary.
-
Clone
visp_ros_coppeliasim
package in the cartkin workspace$ cd ~/catkin_ws/src $ git clone https://github.com/lagadic/visp_ros_coppeliasim.git
-
Build package
$ source /opt/ros/melodic/setup.bash $ cd ~/catkin_ws/ $ catkin_make --cmake-args -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=~/software/visp/visp-build
Back to summary.
- Download the last edu version of
CoppeliaSim
for Ubuntu 18.04 from here (e.g.,CoppeliaSim_Edu_V4_1_0_Ubuntu18_04.tar.xz
). - Extract the archive content in
~/software
workspace. - At this point you should have
CoppeliaSim
in~/software/CoppeliaSim_Edu_V4_1_0_Ubuntu18_04/
folder
Back to summary.
Since CoppeliaSim
comes with a ROSInterface
build for ROS melodic
there is no need to build ROSInterface
.
Back to summary.
In what follows, we assume that CoppeliaSim
is located in ~/software/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04
, that the ROS package visp_ros_coppeliasim
is located in ~/catkin_ws/src
, and that we are going to run the file related to IBVS AprilTag synchronization (see folder visp_ros_coppeliasim/src
for more details).
To properly run the simulator, you will need three terminals, one for the roscore
, one for CoppeliaSim
, and one for the ROS node (note that roscore
should be started before CoppeliaSim
):
-
In terminal 1 run:
$ source /opt/ros/melodic/setup.bash $ roscore
-
In terminal 2 run:
$ source ~/catkin_ws/devel/setup.bash $ cd ~/software/CoppeliaSim_Edu_V4_1_0_Ubuntu18_04 $ LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh
Now in
CoppeliaSim
GUI, enter menu"File > Open scene..."
and browse to~/catkin_ws/src/visp_ros_coppeliasim/coppeliasim_scenes
folder to selectfranka_joint_torque_control.ttt
At this point, in
CoppeliaSim
GUI you should see the following feedback:[sandboxScript:info] Simulator launched, welcome! [CoppeliaSim:info] Default scene was set-up. [CoppeliaSim:info] Loading scene ($HOME/catkin_ws/src/visp_ros_coppeliasim/coppeliasim_scenes/franka_joint_torque_control.ttt). Serialization version is 22. [CoppeliaSim:info] File was previously written with CoppeliaSim version 4.01.00 (rev 1) [CoppeliaSim:info] Scene opened. ROS interface was found.
Be sure that ROS interface is found. If this is not the case, it means:
- either that you forget to
source ~/catkin_ws/devel/setup.bash
, - either that ROS interface that comes with
CoppeliaSim
is not compatible withmelodic
as stated here.
- either that you forget to
-
In terminal 3 run:
$ source ~/catkin_ws/devel/setup.bash $ rosrun visp_ros_coppeliasim ibvs_april_tag_sync
At this point you should be able to see the following in CoppeliaSim GUI:
Moreover, in the display opened when running ibvs_april_tag_sync
node you should also see something similar to:
You need to click in the display to start the visual-servo.
Back to summary.