ARCOS-Lab Humanoid Robot Simulator

Main Developer: Dr. rer. nat Federico Ruiz Ugalde

Maintainer: Daniel García Vaglio

Contributors: Javier Peralta

This is a robot simulator for the ARCOS-Lab Robot. It was originally developed for TUM-Rosie robot. It simulates its two arms and fingers, force and torque sensing. It also simulates friction between an object, a table and a robot finger.

  • You can install this directly on your system if you have Debian Jessie stable.
  • Install software needed
  • * For Debian Jessie:
 sudo apt-get install python-numpy python-scipy python-opengl python-pygame python-matplotlib python-sip python-sip-dev python-qt4-dev python-qt4 python-gtk2 python-gtk2-dev python-vtk python-pyvtk python-gtkglext1 libeigen3-dev python-yaml python-setuptools python-future
  • * For Debian Stretch and newer:
 sudo apt-get install python-numpy python-scipy python-opengl python-pygame python-matplotlib python-sip python-sip-dev python-qt4-dev python-qt4 python-gtk2 python-gtk2-dev python-vtk6 python-pyvtk python-gtkglext1 libeigen3-dev python-yaml python-setuptools python-future
simulator_installer.sh
  #install avispy
  echo "install avispy"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/avispy.git
  cd avispy
  make xstow_install
 
  #install roboview
  echo "install roboview"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/roboview.git
  cd roboview
  make xstow_install
 
  #install cmoc
  echo "install cmoc"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/cmoc.git
  cd cmoc
  make xstow_install
 
  #install pyrovito
  echo "install pyrovito"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/pyrovito.git
  cd pyrovito
  make xstow_install
 
  #install vfl
  echo "vfl"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/vfl.git
  cd vfl
  make xstow_install
 
  #install vfclick
  echo "install vfclick"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/vfclik.git
  cd vfclik
  make xstow_install
 
  #install kdb cart cmd
  echo "install kdb cart cmd"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/kbd-cart-cmd.git
  cd kbd-cart-cmd
  make xstow_install
 
  #install arcospyu
  echo "install arcospyu"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/arcospyu.git
  cd arcospyu
  make xstow_install
 
  #robot_descriptions
  echo "robot_descriptions"
  cd $HOME/local/src
  git clone https://gitlab.com/arcoslab/robot_descriptions.git

Test the simulator

  • Execute Yarp in one terminal:
yarpserver --write
  • In another terminal execute vfclik for right arm:
cd ~/local/src
vfclik -i lwr -i right -d robot_descriptions/arcosbot/kinematics/lwr/ -s
  • In another console execute vfclik for left arm:
cd ~/local/src
vfclik -i lwr -i left -d robot_descriptions/arcosbot/kinematics/lwr/ -s
  • In another console execute hands simulator:
cd ~/local/src
sahand_yarp_sim -s -d -n -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py
  • In another console execute roboviewer visualizator:
cd ~/local/src
pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/arcosbot/kinematics/lwr/ -d robot_descriptions/arcosbot/kinematics/sahand/
  • In another console execute torque simulator:
cd ~/local/src
torque_sim -s -a robot_descriptions/arcosbot/kinematics/lwr/ -c robot_descriptions/arcosbot/kinematics/sahand/calibration_data/finger_calibration_data.py -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py
  • To test the system, in another console send forces to finger tips:
rlwrap yarp write ... /torque_sim/force_in
(1 -2. 0. 0.)
(1 0. 0. 0.)
  • With the first force you should see the arm and finger moving away from the set point.
  • With the second force you should see the arm and finger return to the set point.
  • You can also test the system with the program kbd-cart-cmd. You can run it for the right arm with:
run_right.sh /0
  • Now you can use several keys to control the arm

Cancel all the programs run in the previous instructions.

Sliding model and control without robot

  • In one console execute:
cd ~/local/src
pyrovito -r lwr -a robot_descriptions/tum-rosie/kinematics/lwr/ -d robot_descriptions/tum-rosie/kinematics/sahand/
  • In another console:
planar_sliding_simple
  • In another console:
xfinger_feeder
  • Now you can move a “virtual” finger tip against the box and try sliding it.
  • Try to move the box to the origin (0,0,0) where the coordinate frame is and orient the box in a at 0 degrees. Is it difficult?
  • Now try to move the box to the origin with 0 degrees of orientation in one single shot. Is it difficult?
  • Restart planar_sliding_simple (ctrl-c and the run it again)
  • Now cancel xfinger_feeder and execute:
slider_control_simple
  • Now the computer should move the box by itself to the “goal”.

Sliding controller with the whole robot

  • Cancel all the programs run on the last instructions.
  • Run the following commands in different consoles from the directory ~/local/src/
vfclik -i lwr -i right -d robot_descriptions/tum-rosie/kinematics/lwr/ -s
vfclik -i lwr -i left -d robot_descriptions/tum-rosie/kinematics/lwr/ -s
sahand_yarp_sim -s -d -n -f robot_descriptions/tum-rosie/kinematics/sahand/hands_kin.py
  • Wait until they are fully running. Then execute this one:
pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/tum-rosie/kinematics/lwr/ -d robot_descriptions/tum-rosie/kinematics/sahand/
  • Wait until it is fully running and execute:
torque_sim -s -a robot_descriptions/tum-rosie/kinematics/lwr/ -c robot_descriptions/tum-rosie/kinematics/sahand/calibration_data/finger_calibration_data.py -f robot_descriptions/tum-rosie/kinematics/sahand/hands_kin.py
  • Wait until it is fully running and execute:
planar_sliding -o cmoc/objects/sliding/objects/ice_tea_params.py
  • Wait until it is fully running and execute:
slider_control  -s -f robot_descriptions/tum-rosie/kinematics/sahand/hands_kin.py -o cmoc/objects/sliding/objects/ice_tea_params.py
  • This will move the box to the goal by the whole robot!

DLR HIT II

Now if you want to run the simulation using the new hand (DLR HIT II):

vfclik -i lwr -i right -d robot_descriptions/arcosbot/kinematics/lwr/ -s
vfclik -i lwr -i left -d robot_descriptions/arcosbot/kinematics/lwr/ -s
sahand_yarp_sim -s -d -n -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py
pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/arcosbot/kinematics/lwr/ -d robot_descriptions/arcosbot/kinematics/sahand/
torque_sim -s -a robot_descriptions/arcosbot/kinematics/lwr/ -c robot_descriptions/arcosbot/kinematics/sahand/calibration_data/finger_calibration_data.py -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py
planar_sliding -o cmoc/objects/sliding/objects/ice_tea_params.py
slider_control  -s -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py -o cmoc/objects/sliding/objects/ice_tea_params.py

Installation

Download and compile fri stanford library. Remember to update yarp. This uses the latest API. You will have to recompile and reinstall yarp.

cd ~/local/src
git clone ssh://gitolite3@arcoslab.eie.ucr.ac.cr/fri_stanford
cd fri_stanford/Linux
mkdir -p x64/release/obj
mkdir -p x64/release/lib
mkdir -p x64/release/bin
make all_release_x64

If you want to build for debugging, first follow the normal steps and then

sudo apt-get install g++-multilib

Running

  • Configure your network:

The KRC has to network interfaces. One is connected to the windows operating system and the other one is connected to the QNX virtual machine for the LWR controller. In ARCOS-Lab the windows interface has the ip 192.168.3.10, the QNX interface has the ip 192.168.2.250.

Connecting your computer to the FRI network

The host computer (your computer or the computer running the FRI-yarp bridge) must have the following ip address: 192.168.2.113. This is configured in some .ini file in the KRC.

  • Connect the host computer (your computer) to the same physical network as the KRC.
  • Run the host computer (your computer):
sudo ifconfig eth0 up
sudo ifconfig eth0:0 192.168.2.113 netmask 255.255.255.0
  • Test the connection to the robot:
ping 192.168.2.250
  • It must responde with packages with low latency

Connecting your computer with the KRC windows operating system

You can also connect to the same network of the KRC windows OS. This may be useful for editing or copying files:

  • Configure your network interface to be also in the same network of this windows computer:
sudo ifconfig eth0:1 192.168.3.113 netmask 255.255.255.0
  • Test the connection to the windows OS:
ping 192.168.3.10

Access the KRC windows files in your computer

  • Create a mount directory for the KRC windows files:
mkdir -p mnt/krc
  • mount the windows files in a local host directory (password: user):
sudo mount -t cifs -o user=user //192.168.3.10/krc mnt/krc/

Now you can access the KRC windows files in your linux computer

Running the FRI-yarp bridge

  • Run FRI-yarp server-bridge:
cd ~/local/src/fri_stanford/Linux/x64/release/bin
sudo su
cd
export HOME=/home/my_user
. /home/my_user/.bashrc
export HOME=/root/
cd -
./LWR_yarp_arcos

Running the FRI KRC KRL client controller code

  • Turn on the KRC box (big black switch CW 90 degrees)
  • In the Kuka Pendant:
    • Rotate the key on top of the Kuka Pendant to the spiral without dot position.
    • Select Position Control with LWR button
    • Press the Button next to the key (the one with a vertical bar)
    • Configure→Set tool/base→ Tool no: 1(empty) 2(hand) 3(L link), base no: 1
    • With the file manager, go to: R1/Program/FRIDemo/
    • Select file FRIControl
    • Select Position Control with LWR button
    • Monitor→Variable→Single→Name: $torque_tcp_est (check that torques and forces don't exceed a value of 2)
    • Close Monitor window
    • Press green + button several times until no more advancing happens in the code
    • Press enter in the LWR_yarp_arcos console
    • Press green + button more times until no more advancing happens in the pendant code

Restarting in case of bad communication quality

  • Ackknowled all messages in Pendant
  • Press black button with circle to denergize the drives
  • Press the white button with vertical bar next to the key to reenergize the drives
  • Press the green button with “+” several times until FRI switches to joint impedance control. During this the arm moves to the starting position and then to the last commanded position. Beware!!!!

Starting the vfclik system for the real robot

  • Remember to start the FRI yarp bridge first (look above)
  • Remember to change robot_descriptions branch to fri-integration
cd ~/local/src/robot_descriptions
git checkout fri-integration
  • VFCLIK:
cd ~/local/src
vfclik -i lwr -i right -d robot_descriptions/arcosbot/kinematics/lwr/
  • Visualization (pyrovito):
cd ~/local/src
pyrovito -r lwr --arm_right --hand_right -a robot_descriptions/arcosbot/kinematics/lwr/ -d robot_descriptions/arcosbot/kinematics/sahand/
  • Joint limits visualization:
cd ~/local/src
bar_vis
yarp connect /lwr/right/debug/qdist /bar_vis/bar/in
  • Keyboard control:
run_right.sh
  • To control nullspace movement:
yarp write ...  /lwr/right/nullspace/control

In this console you can write nullspace speed movements. Try small numbers like 0.1 first.

This is a work in progress!

Make sure to checkout fri-integration in robot-descriptions and cmoc.

vfclik -i lwr -i right -d robot_descriptions/arcosbot/kinematics/lwr/ -s
sahand_yarp_sim -s -d -r -n -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py
pyrovito -r lwr --arm_right --hand_right -a robot_descriptions/arcosbot/kinematics/lwr/ -d robot_descriptions/arcosbot/kinematics/sahand/
torque_sim -s -a robot_descriptions/arcosbot/kinematics/lwr/ -c robot_descriptions/arcosbot/kinematics/sahand/calibration_data/finger_calibration_data.py -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py -r
run_right.sh
python ~/local/src/cmoc/robot/tests/fith_finger_tester.py -s -c ~/local/src/robot_descriptions/arcosbot/kinematics/sahand/calibration_data/finger_calibration_data.py -f ~/local/src/robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py

If you have problems installing directly on your system, try using a chroot.

If not, install debian in a chroot Debian Unstable inside a Chroot. In this step I recommend using this:

debootstrap --arch amd64 sid /var/sid-amd64-chroot http://snapshot.debian.org/archive/debian/20150918T095308Z 
  • and this script instead:
#!/bin/bash
CHROOT_DIR=/var
CHROOT_NAME=`basename $0 .sh` 
DIS_NUM=`echo $DISPLAY`

if [ ! -e /var/run/$CHROOT_NAME ]
then
    sudo touch /var/run/$CHROOT_NAME
    sudo bash -c "echo 1 > /var/run/$CHROOT_NAME"
else
    sudo bash -c "echo `expr 1 + \`cat /var/run/$CHROOT_NAME\`` > /var/run/$CHROOT_NAME"
fi

if [ `cat /var/run/$CHROOT_NAME` -eq 1 ]
then
    echo "First chroot invocation. Mounting host system directories"
    sudo mkdir -p $CHROOT_DIR/$CHROOT_NAME/hostfs
    #mount -o bind /home/ $CHROOT_DIR/$CHROOT_NAME/home
    sudo mount proc -t proc $CHROOT_DIR/$CHROOT_NAME/proc
    sudo mount -o bind /dev $CHROOT_DIR/$CHROOT_NAME/dev
    sudo mount sys -t sysfs $CHROOT_DIR/$CHROOT_NAME/sys
    sudo mount none -t devpts $CHROOT_DIR/$CHROOT_NAME/dev/pts
    sudo mount -o bind / $CHROOT_DIR/$CHROOT_NAME/hostfs
    sudo mount -o bind /run/shm $CHROOT_DIR/$CHROOT_NAME/run/shm
    xhost +local:
fi

echo "Starting chroot."
#dchroot -c $CHROOT_NAME
sudo chroot $CHROOT_DIR/$CHROOT_NAME su - $1
export DISPLAY=$DIS_NUM
echo "Chroot closed."

if [ `cat /var/run/$CHROOT_NAME` -eq 1 ]
then
    echo "Closing last invocation. Unmounting host system directories"
    for i in dev/pts proc dev sys run/shm hostfs
    do
  sudo umount $CHROOT_DIR/$CHROOT_NAME/$i
        sleep 0.5
    done
fi

sudo bash -c "echo `expr \`cat /var/run/$CHROOT_NAME\` - 1` > /var/run/$CHROOT_NAME"

if [ `cat /var/run/$CHROOT_NAME` -eq 0 ]
then
    sudo rm /var/run/$CHROOT_NAME
fi

Instead of this:

debootstrap --arch amd64 sid /var/sid-amd64-chroot http://ftp.us.debian.org/debian/

It is basically a particular debian sid snapshot where everything else in this tutorial is known to work.

If you encounter an X server error while executing the simulator, check the following:

  • If DISPLAY environment variable of the chroot is the same as the host machine
  • If the graphics driver of the chroot and the host machine are the same
  • If the host Xserver allows indirect rendering

If you encounter errors with multiprocessing. Add the following line to /etc/fstab

none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

And then execute:

sudo mount /dev/shm

* Open a terminal and execute Yarp:

yarpserver start

* In another console execute vfclik for right arm:

cd ~/local/src/
vfclik -i lwr -i right -d robot_descriptions/arcosbot/kinematics/lwr/ -s

* In another console execute vfclik for left arm:

cd ~/local/src/
vfclik -i lwr -i left -d robot_descriptions/arcosbot/kinematics/lwr/ -s

* In another console execute hands simulator:

cd ~/local/src/
sahand_yarp_sim -s -d -n -f robot_descriptions/arcosbot/kinematics/sahand/hands_kin.py

* In another console execute roboviewer visualizator:

cd ~/local/src/
pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/arcosbot/kinematics/lwr/ -d robot_descriptions/arcosbot/kinematics/sahand/

Module: Bridge

weights port

  • Name: /lwr/right/bridge/weights
  • Description: This is used to select which controller controls the robot, one can select between vfclik, nullscace, jointcontroller, mechanism, xtra1, xtra2
  • Usage example: 1.0 1.0 0.0 0.0 0.0 0.0 Selects vfclik and nullspace controllers
  • Usage example: 0.0 0.0 1.0 0.0 0.0 0.0 Selects joint controller

Module: vectorField

weight port

  • Name: /lwr/right/vectorField/weight
  • Description: This is used to adjust the importance of a joint or task space dimension during the jacobian calculation for cartesian movement.
  • Usage example: j 1 1 1 1 1 1 1 Uses all 7 joints as much as possible
  • Usage example: t 1 1 1 1 1 1 Uses all 7 task space dimensions as equally important

Module: Object feeder

object port

  • Name: /lwr/right/ofeeder/object
  • Description: This port is used to feed objects to the vfclik system. It can accept obstacles and goals.
  • Usage example: set goal (-0.995363 0.001243 0.096186 0.979951 0.062618 0.767426 0.638073 -0.348856 -0.073022 0.641137 -0.763945 0.861143 0 0 0 1)

Module: joint controller

reference port

  • Name: /lwr/left/jpctrl/ref
  • Description: This port accepts joint positions.
  • Usage example: -0.4 0.3 0.1 0.5 0.5 0.5 0.5

Module: Distance monitor

Distance out port

  • Name: /lwr/right/dmonitor/distOut
  • Description: This port outputs the distance to current goals/obstacles
  • example: (object/goal number, linear distance (meters), angular distance (degrees)

Module: Debug module

Joint Distance port

  • Name: /lwr/right/debug/qdist
  • Description: This port outputs distances in percentage to joint limits
  • Usage example: 19.6106992983374 60.6037843402149 14.0171939079065 73.3064145340412 31.6837274879154 -53.8251156968477 59.6518223463255

Module: Nullspace

Control port

  • Name: /lwr/right/nullspace/control
  • Description: This port accepts a list of nullspace speeds for each nullspace variable
  • Usage example: 0.0 : No movement in nullspace, 0.5 : Positive movement in nullspace, 0.1 0.3: Two nullspaces used
  • tutorials/object_manipulation_robot_simulator.txt
  • Last modified: 2018/12/24 15:21
  • by dgarcia