We'll use [4] for implementing and demonstrating the course assignments.
It is recommended to use the following requirements to avoid any unforseen error during the implementation of the codes.
- Ubuntu 20.04
- ROS Noetic
If you are using windows or run an older version of ubuntu on your PC, you can use VMWare Workstation Player to run ubuntu 20 which is free for non-commercial use. In that case, follow the instructions below to install and prepare you virtual machine:
- depending on your current version of operating system, download one of the installers from VMWare Installers.
- on windows, just run the installer GUI and follow the instructions
- on Ubuntu install it from command lines:
$ cd "PATH/TO/DOWNLOADED/FOLDER" #change directory to where you have downloaded the .bundle (installer) file
$ sudo sh VMware-Player-15.5.6-16341506.x86_64.bundle #change .bundle file name if necessary
- Download an ubuntu .iso image from Ubuntu 20 ISO file
- open VMWare Workstation Player and create an new environment from the ISO file and set the hardware properties as you wish.
The github repository provided here is the modified version of [4] that some of its bugs are fixed and we'll maintain it during the course implementation.
$ sudo apt-get install ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control
$ sudo apt-get install ros-noetic-effort-controllers
$ sudo sh \
-c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \
> /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install python3-catkin-tools
$ mkdir -p elfin_ws/src
$ cd ~/elfin_ws/src
$ git clone https://github.com/tau-alma/edu-elfin_simulation.git
$ cd ~/elfin_ws/
$ catkin build
Motion controllers in joint space
$ roslaunch elfin_gazebo elfin3_empty_world.launch controller:=gravity_comp_controller
or
$ roslaunch elfin_gazebo elfin3_empty_world.launch controller:=time_delay_controller
or
$ roslaunch elfin_gazebo elfin3_empty_world.launch controller:=computed_torque_controller
or
$ roslaunch elfin_gazebo elfin3_empty_world.launch controller:=computed_torque_clik_controller
If you want to use motion and force controller in task space, then you may choose this controllers as follows:
$ roslaunch elfin_gazebo elfin3_experiment1_world.launch controller:=adaptive_impedance_controller
or
$ roslaunch elfin_gazebo elfin3_experiment2_world.launch controller:=adaptive_impedance_controller
If you want to plot data in rqt graph, use rqt_plot.launch file. Customize perspective files to plot data you need.
$ roslaunch rqt_plot.launch controller:=gravity_comp_controller
- If you are using VMWare and gazebo keeps crashing during run time, try the following:
$ echo "export SVGA_VGPU10=0" >> ~/.bashrc
- before running any of the sample codes, you also need to issue the following command from your /catkin_ws directory so the built nodes and launch files could be found in terminal:
$ source devel/setup.bash
- If your gazebo environment and the robot is too dark, find the corresponding world file (for example empty.world) location and add the followings to the world:
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.25 0.25 0.25 1</background>
<shadows>false</shadows>
</scene>
=======