Utilizando o ambiente do VRC - CloudSim

De LCAD
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: Step 5: Start a task

Press the start button of the task you want to launch. The task status icon should start flashing yellow, until the simulator is started on the Cloud. Once the simulator is running (as indicated by the blue status on the simulator machine), the task status icon will flash blue, until the task is stopped.

    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.

Execute os comandos sempre que fizer ssh para uma máquina:

cd fc1_OSRF_VRC_Constellation_01
./ssh-fc1.bash
. cloudsim/ros.bash
# Now my ROS environment is configured, so things like `rostopic` and `rviz` will work, once a simulation task is running.


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 Step 5: Start a task

Press the start button of the task you want to launch. The task status icon should start flashing yellow, until the simulator is started on the Cloud. Once the simulator is running (as indicated by the blue status on the simulator machine), the task status icon will flash blue, until the task is stopped. 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.

Iniciando uma task

Press the start button of the task you want to launch. The task status icon should start flashing yellow, until the simulator is started on the Cloud. Once the simulator is running (as indicated by the blue status on the simulator machine), the task status icon will flash blue, until the task is stopped.

The scoring information will be displayed in the Simulation Tasks block during task execution.

Executando uma task

Now that your task is running, you're ready to actually achieve it. Start your software on the Field Computers and/or your OCU and get to it.

Com a vpn ligada faça ssh para a máquina que você deseja usar e execute os comandos.

Lembre após executar o ssh de executar os comandos:

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

Parando uma task

To stop the currently-running task, press the Stop current task button (above the tasks). The task status indicator will start flashing red and turn to solid red once the simulator has shut down. During this phase, your log files will be uploaded into your Portal. This operation may take some minutes if your log file is large.

Fazendo download dos arquivos de log

The VRC 2013 Practice tab of your VRC Portal team page will show score information for your finished tasks. In addition, you will be able to download a single zip file with the simulation and network usage logs.