ARCOS-Lab Humanoid Robot Simulator

Main Developer: Dr. rer. nat Federico Ruiz Ugalde

Maintainer: Daniel García Vaglio

Contributors: Javier Peralta

Description

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.

Installation instructions

  • 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 python-colorlog
  • * 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 python-colorlog
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
  git checkout 0.1.2
  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

Sliding model and control

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

WARNING: planar_sliding and slider_control will fail because of some changes that were introduced for the dual-cmap project. And it will probably remain deprecated because OMS is replacing CMOC.

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

Real robot

FRI robot communication

Installation

KRC

Check that you have FRI properly installed. In case that there are network communication problems some times there is a problem with the network card installation. The KRC has two network cards, one for Windows and one for VXworks. To be sure that the one for VXWorks is properly installed, go to control-panel→ Device Manager, and check that the PCI network controller is listed under “Realtime OS Devices” and not under “Network Adapters”. If it is under “Network Adapters” it means windows has “claimed” it. To reassign it to VXWorks, insert the FRI installation CD and go to INTERNAT\KRCUPD directory and run “KsNetCfg.exe”. This will install again the VXWorks network adapter card. This is usually a problem with the Intel Pro1000 GT card. Reboot and reconfigure FRI ini files.

Linux 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

Gravity

Please check that the gravity vector is correctly configured. After you have selected the current payload (configure→set_tool/base→tool_no/base_no), go to monitor→variable→single and introduce in “name”: $torque_tcp_est. Press shift-enter to have realtime variable updates. They should show small values No more than 5 Newtons in x,y or z. If they are big, this usually means, that either the payload is not properly selected, or that the gravity vector is incorrect.

To check the current gravitation vector monitor→variable→single in “name”: $gravitation[]. To permanently change the gravitation values, edit file : c:\krc\roboter\krc\steu\mada\$custom.dat. At the beginning of the file you will find the variable values.

Running

  • Configure your network:

The KRC has two 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.

If this configuration is wrong in the KRC you can fix it by:

  • Edit file C:\windows\vxwin.ini
[Boot]
Bootline=elPci(0,1)pc:vxworks h=192.0.1.2 b=192.0.1.1 e=192.168.2.250 u=target pw=vxworks
  • Edit file C:\krc\roboter\init\Dlrrc.ini
[DLRRC]
TIMEOUT=25
IMMEDIATE_STARTUP=1
FRIHOST=192.168.2.113
FRISOCK=49938,0
FRIKEY=(use provided key)

We had troubles using an Intel Giga network controller. The 3Com one works correctly. To check that windows is properly detecting and using the FRI network controller, go to the windows “Device Manager” and check that the 3Com network controller is assigned as part of a “Realtime OS Devices” section and not inside “Network adapters” section.

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
  • You can use the following bash script for configuring and testing FRI connectivity:
#!/bin/bash

if [ $1 = up ]
then
  echo "Disabling previous wired network configuration"
  sudo ifdown eth0
  sleep 2
  sudo ifdown eth0
  sleep 2
  echo "Turning wired network on"
  sudo ifconfig eth0 0.0.0.0 up
  echo "Kuka FRI network"
  sudo ifconfig eth0:0 192.168.2.113 netmask 255.255.255.0
  echo "Kuka KRC windows network"
  sudo ifconfig eth0:1 192.168.3.113 netmask 255.255.255.0
  echo "Wessling robotics Hand network"
  sudo ifconfig eth0:2 192.168.200.10 netmask 255.255.255.0
  echo "Checking communication with robot parts"
  ping -i 0.3 -w 3 -c 5 192.168.2.250
  if [ $? != 0 ]
  then
      echo "Comunication error with Kuka FRI, check FRI network"
      exit 1
  fi
  ping -i 0.3 -w 3 -c 5 192.168.3.10
  if [ $? != 0 ]
  then
      echo "Comunication error with Kuka KRC windows, check Kuka KRC windows network"
      exit 1
  fi
  ping -i 0.3 -w 3 -c 5 192.168.200.1
  if [ $? != 0 ]
  then
      echo "Comunication error with Wessling robotics Hand, check Hand network"
      exit 1
  fi

fi
if [ $1 = down ]
then
  echo "Turning all robot networks down"
  echo "Wessling robotics Hand network"
  sudo ifconfig eth0:2 down
  echo "Kuka KRC windows network"
  sudo ifconfig eth0:1 down
  echo "Kuka FRI network"
  sudo ifconfig eth0:0 down
  echo "Turning wired network off"
  sudo ifconfig eth0 down
fi

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 //192.168.3.10/krc /mnt/krc/ -o user=user,vers=1.0

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

Common Problems

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

Running the Dual Capability Map System

* 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/

Yarp port descriptions

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: 2019/06/16 14:39
  • by dgarcia