User Tools

Site Tools


tutorials:robots:ur:ur_sim

URSim Polyscope

Software on podem simular que tinguem la consola de programació del robot. Es com si tinguérem el robot, els moviments els vorem al simulador.

Parpadeix i lentitud

Amb la MV, amb el 3D activat no papadeja pero va lent. Amb el 3D desacitvat parpadeja, però va mes rapid.

Parpadeja per un tema de FPS, amb glxgears, si ets sincronitzen amb Vsync amb el refrecs de la pantalla no es parpadeja, no se com es pot activar el Vsync, al host i al guest perquè no parpadeje.

Amb el docker/gaucamole (des del navegador), ha de tenir una resolució de x1024, el eix y de l pantalla(vertical) ha de tenir com a minim 1024 amb linux es facil escal·lant la pantalla:

 xrandr --output LVDS-1 --scale 1.34x1.34 --panning 1820x1024

(Cal calcular el factor des de la resolucio actual a la nova(xrandr surt la resolucio actual) per tenir 1024, i el panning perque arribe el ratoli.

Si posem només el –panning no es reduiex la pantalla però no la veus tota quan et mous per la pantalla va apareguen.

Instal·lació MV

Els software està programat en JAVA, en teoria podria utilitzar-se a qualsevol plataforma però segurament l'ús de llibrerires natives del UBUNTU 14.04 fa que només funcion be amb aquest sistema. Així que la millor solució tant per a Linux(18.04), Mac o Windows es descarregar-se la maquina virtual i fer-la córrer amb el VirtualBox. Per la qual casa cal instal·lar primer el VirtualBox.

Ho dividim en passos per ser un procés una mica llarg

1. Baixar-se i instal·lar el VirtualBox. Es un programa que et dona la posibilitat de tenir diversos sistemes operatius(guest-convidats) al ordinador sense que afectin en res al sistema principal(host). Els sistemes operatius convidats(guest) son en realitat només un arxiu que es el disc dur de l'altre sistema, aixó si ocupa diversos giges (en el nostre cas 3,6 GB), que ja descarregarem al seguent pas. Ara instal·lem el VirtualBox

2. Descarregar-se la maquina virtual que posarem a dintre del VirtualBox.

Aquí es descargareu el contingut del disc i caldrà crear una màquina ubunutu de 32bits. Si voleu una forma més fàcil podeu descarregar-vos l'exportació que jo he fet. En aquest cas nomes cal anar a arxiu/importar i triar l'arxiu URobotics-Lubuntu32bits.ova

En el seguent video del youtube https://www.youtube.com/watch?v=xNXJS-xcxN8 explica com importar un arxiu ova. amb el virtualbox, en aquest cas importen el KaliLinux(Utilitzat en seguretat de xarxes), en compte del kali linux cal instal·lar el nostre URobotics-Lubuntu32bits.ova.

Instal·lació LINUX

Dona problemes a les noves versions, jo vaig arribar a les mateixes conclussions:

I investigated this more and found the real solution. When the software is installed, it has created under /opt a folder urtool-3.0 with some libs and bins. The current simulation software is 32 bit, most Linux installations are now 64 bit. The simulator installs some 32 bit dependent libraries under /opt/urtool-3.0. The software URControl for example needs libs from this /opt/urtool-3.0 folder. Ok, now what about the script start-ursim.sh ? Normally you should run ./start-ursim.sh UR3 for example to start the simulator. But on recent Linux distributions it fails to run the URControl, and you end up with a non working simulator, compaining about 'No controller'. This script is running internally 2 sub scripts, namely stopurcontrol.sh and starturcontrol.sh. The first script kills the URControl software, the seconds is aimed at starting URControl. But the start script DOES NOT RUN the URControl software. When runing the script it just fails to start, and this happens as well with the virtual machine simulator version. I even removed the calling of the script (starturcontrol.sh) inside the start-ursim.sh. And guess …. when doing this in the virtual machine version, the software still starts correctly. Checking afterwards shows that the URControl is running…so something else starts the URControl. Probably this is started from the java software. Now back to recent Linux distributions,like Linux min 19.2 : Thinking about how the URControl is started now, it is logic that on recent Linux distributions this will fail, as running start-ursim.sh UR3 for example has no environment telling where the dependent libs need for URControl are on your system ! Now running the following command : LD_LIBRARY_PATH=/opt/urtool-3.0/lib ./start-ursim.sh UR3 Tada… Software starts up correctly and runs fine….. P.S. Do not forget to have a java inside your PATH which is fairly recent (i used java runtime 1.8.0)

Mes instrccions, https://github.com/arunavanag591/ursim, com_installar_ursim-master.zip

How to Install Ursim (Polyscope Interface - Universal Robot):

  Install Java 8.
  Change the following line, in install.sh file: ( A sample file could be found in the repo) commonDependencies='libcurl3 openjdk-6-jre libjava3d-* ttf-dejavu* fonts-ipafont fonts-baekmuk fonts-nanum fonts-arphic-uming fonts-arphic-ukai' to
  commonDependencies='libcurl3 openjdk-8-jre libjava3d-* ttf-dejavu* fonts-ipafont fonts-baekmuk fonts-nanum fonts-arphic-uming fonts-arphic-ukai'
  Make sure the system is sourcing or using java8. This can be done by:
      Find the version of java that is running or sourced by java -version
      if there are multiple version use: sudo update-alternatives --config java
      select the version to be jdk 8.
  Change the following files to be executable sudo chmod +x filename.sh
      start-ursim.sh
      starturcontrol.sh
      stopurcontrol.sh
      URControl
  Run in the terminal bash install.sh or . install.sh from the unzipped folder.
  Run bash start-ursim.sh or . start-ursim.sh from the unzipped file directory system.
  

Instal·lació DOCKER

En aquest cas ho fa amb una dockerfile, que està al github, docker build ./dokerfile.

https://github.com/ahobsonsayers/DockURSim, dockursim-master.zip

A URSim (Universal Robots Simulator) Docker Container with a Browser Accessible Interface

Runs URSim in a docker container with the Polyscope Interface accessible via a browser.

This is a suitable alternative to using the URSim virtual machine image on windows.

Current URSim Version: 5.4.2.76197 Example Usage

First create volume to store robot configuration.

docker volume create dockursim

Start URSim with an UR5 robot and all interface ports exposed.

docker run -d \
    --name="dockursim" \
    -e ROBOT_MODEL=UR5 \
    -p 8080:8080 \
    -p 29999:29999 \
    -p 30001-30004:30001-30004 \
    -v /path/to/mount/program/folder:/ursim/programs \
    -v dockursim:/ursim \
    --privileged \
    --cpus=1 \
    arranhs/dockursim:latest

The Universal Robot Interface can now be accessed at http://localhost:8080.

Ctrl-Alt-Shft will open a menu that allows changing input options, as well as controlling the clipboard.

NOTE! This container requires running with –privileged set due to pthread spawn issues that couldnt be solved in any other way. This has security implications so DO NOT expose this container to the internet without doing your due diligence first. Use this container at your own risk.

NOTE Number 2! I highly recommend running this container with the –cpus=1 option as the container seems to use all available machine resources otherwise and this will likely cause your simulator container (and possibly your computer) to become unresponsive or slow. Parameters

Container is configured using parameters passed at runtime. Parameter Function -e ROBOT_TYPE=UR5 Specify robot model to use in URSim. Valid options are UR3, UR5 and UR10. Defaults to UR5. -e TZ=Europe/London Specify a timezone to use e.g. Europe/London -e PUID=1000 Set UserID -e PGID=1000 Set GroupID -v /ursim The URSim application directory -v /programs The UR programs directory. This is accessible within the robot interface -p 8080 Allows HTTP access to the robot interface. (Required for Browser Viewing) -p 3389 Allows RDP access to the robot interface. (Optional. For VNC Viewers) -p 502 Universal Robots Modbus Port. (Optional) -p 29999 Universal Robots Dashboard Server Interface Port. (Optional) -p 30001 Universal Robots Primary Interface Port. (Optional) -p 30002 Universal Robots Secondary Interface Port. (Optional) -p 30003 Universal Robots Real-time Interface Port. (Optional) -p 30004 Universal Robots RTDE Interface Port. (Optional)

The volume and port parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

This container was built in my free time to aid with research work. Please feel free to open any issues.

Programació

tutorials/robots/ur/ur_sim.txt · Last modified: 2021/10/19 01:24 by crevert