Utilizando o ambiente do VRC - CloudSim

De LCAD
Revisão de 16h48min de 4 de junho de 2013 por Tiago Alves de Oliveira (discussão | contribs) (Criando uma task)
Ir para: navegação, pesquisa

Acessando o ambiente

Acesse o site http://vrcportal.osrfoundation.org.

Clique em Sign In.

Entre com o usuário robotics.team.br@gmail.com.

Clique em VRC 2013 Practice para a prática ou VRC 2013 Final para a competição.

Vai aparecer uma janela que tem o link do CloudSim. Clique nele.

Clique em login.

Faça o login com o usuário robotics.team.br@gmail.com.

Clique em console.

Baixe todas as chaves das máquinas.

Habilitando a VPN

Para utilizar a VPN, baixe o openvpn:

$ sudo apt-get install openvpn

Com a chave na pasta Downloads, execute:

mkdir vrc_credentials
cd vrc_credentials
unzip ~/Downloads/router.zip
cd router_OSRF_VRC_Constellation_01
sudo ./start_vpn.bash

Você deverá ver algo como:

Killing other openvpn connections...
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Adding route to 10.0.0.0/24 network
VPN ready.  To kill it:
    sudo killall openvpn

Para verificar se você tem conexão com as máquinas

# ping the router
ping 10.0.0.50

# ping the simulator
ping 10.0.0.51 

# ping field computer 1
ping 10.0.0.52

# ping field computer 2
ping 10.0.0.53

Note: Antes de rodar qualquer código no OCU, você vai precisar de fazer o seguinte:

. /usr/share/drcsim/setup.sh
cd router_OSRF_VRC_Constellation_01
. ros.bash
# Now my ROS environment is configured, so things like `rostopic` will work, once a simulation task is running.

Faça isso em todo shell que você for usar.

Conectando nas máquinas fields

Baixe as chaves para as máquinas Field Computer 1 e Field Computer 2. Descompacte cada chave da máquina e execute o script ssh para logar na máquina. Por exemplo, para rodar na Field Computer 1:

cd ~/vrc_credentials
unzip ~/Downloads/fc1_OSRF_VRC_Constellation_01.zip
cd fc1_OSRF_VRC_Constellation_01
./ssh-fc1.bash 

Você irá logar na máquina Field Computer usando o usuário ubuntu. Lembre-se de usar o sudo para executar um comando como superusuário.

Instalando o CARMEN

Para instalar o CARMEN use o tutorial Carmen VRC

Instalando o ROS

Para instalar o ros siga os tutorials:

Criando uma task

You will be logged into your CloudSim as an officer, which allows you to create simulation tasks.

Click on the Create task button of the Simulation tasks block. Fill in the dialog window:

  • Task title: The title of your task.
  • ROS package: In which ROS package the desired launch file is found. Use `atlas_utils` to practice with the provided Qualification and/or Practice arenas (e.g., `qual_task_1.launch`, `vrc_task_1.launch`).
  • Launch file: Which launch file to use; usually `vrc_task_1.launch`, `qual_task_1.launch`, or similar.
  • Maximum time (sec): This value sets the maximum number of simulation time seconds allowed for your task. When the maximum time is reached, your task will be automatically stopped.
  • Arguments: Not used.
  • Minimum latency: Set the latency between the OCU and the Field Computer and Simulator machines.
  • Uplink data cap: Maximum number of uplink bits allotted for the task.
  • Downlink data cap: Maximum number of downlink bits allotted for the task.
  • Valid from: Do not modify this value during Practice.
  • Valid until: Do not modify this value during Practice.
  • Run: Valid values are 1, 2, 3, 4, or 5.
  • Task: Valid values are 1, 2, 3.

Note 1: Your Run/Task combination will be used to display your practice data in the appropriate tab on your Portal, and will determine the name of the resulting log files. If you run two tasks with the same Run/Task combination, the second one will overwrite log files from the first one.

Note 2: Your uplink/downlink network connections will be disabled if you reach your cap limits. The network connectivity will be restored for every task. The byte usage counter is activated when your robot crosses the first gate.

Press the Create button and your new task will appear in the Simulation Tasks block.