Skip to content

How to start Vizzy up

João Avelino edited this page Nov 26, 2019 · 42 revisions

Introduction

This is the guide to start Vizzy up and prepare it to run the demos. Before following this guide please read the Hardware page very carefully. You will have information about the power sources, power plugs, and emergency buttons there. Also information about the cameras that will be needed for sure. You have been warned!

Turning PC, Segway, control boards and motors on.

First, make sure the battery to power source cable (the one that says LOAD) is plugged:

Power cable

There are two switches next to the waist of Vizzy. The switches are labelled as “Power” and “Boards”. The “Power” one is the main switch (currently does nothing due to a relay problem), which provides battery power to the pc and power boards of motor control. You should turn on these switches. Notice that after turning on the boards switch you will see the control boards' leds turning on. If that does not happen, then the power source cable (LOAD) is probably disconnected:

Power button

The PC (vizzy-desktop) must be turned on by pushing power button on the motherboard in the robot's front left corner approximately (See picture below) Power button. The switch closer to the motor (“Boards”) turns on the power and control boards of the motors. When switched on the boards should start blinking:

The segway has two buttons, a yellow button with a thunder and a green button. Push first the green button on and then the yellow one. Segway off Segway green on Segway yellow on The sequence is illustrated in the above picture.

Laptop configuration (vizzy-laptop).

After turning on the laptop, select the Ubuntu option in the boot loader. Then, login with user vizzy and the corresponding password. In order to connect remotely to the PC (vizzy-desktop), find the wireless Access Point Vizzy_5G and connect to it. The IP addresses are:

10.10.1.90	Access Point (Vizzy 5G)
10.10.1.80	vizzy-desktop
10.10.1.82	vizzy-laptop (check this out)
10.10.1.53	vislab-PORTEGE-R930 (Old laptop. The new laptop's name is vizzy-laptop)

The netmask is: 255.255.0.0

In case something is not working, the connection to the Access Point may be the problem. There is also the option of connecting the laptop to the Access Point with Ethernet cable, which is very useful if you want to debug code and run GUI software such as yarpmmotorgui and yarplogger. To do this, just plug the Ethernet cable from the laptop to the router and select the connection “Ethernet 10.10.1.53” (TBD on the new laptop)

Connecting with other devices

If you want to connect to Vizzy_5G with another device (computer, tablet, phone, etc...) you will need to manually configure your IP address, since Vizzy does not have an active DHCP server. You will need to choose an IP address that is different from the ones in the previous list. (A guide for Ubuntu and Android is on this page)

Vizzy's PC (vizzy-desktop) network configuration.

Communication with Vizzy

The default way to communicate with Vizzy is through its Wi-Fi network's Access Point (AP, named Vizzy_5G). You should connect vizzy-laptop (or other device) to the Vizzy_5G Wi-Fi network.

Connecting Vizzy to the internet in ISR

The AP does not provide internet access to vizzy-desktop. So if you want to access the internet (usually just for commits and pulls), you need to connect the purple ethernet cable underneath the table where Vizzy usually is, and plug it to the router, which allows to connect to the 10.10.1.X network (visnet). In order to check the wired connection, ping to 10.10.1.80. The default connection is through the AP and to set it up you just need to plug the short purple cable between the AP and the ethernet plug of vizzy-desktop. If any of the connections does not work just unplug the ethernet cable and wait for 30 seconds, and then connect it again. The gateway (10.10.1.254) needs to be set properly.

Connecting Vizzy to the internet outside ISR using Vodafone modem

The difference to the above connection, is just to delete the gateway from the Vizzy5G connection using the command sudo nm-connection-editor, and plug the Vodafone wifi modem to one of the USB ports. You may need to unplug and plug again the network cable on vizzy-desktop.

Running software

YARP

  • icub-cluster.py (at laptop), graphical interface for running yarpserver and yarprun remotely. You can run the following command in a terminal:
icub-cluster.py vizzy-cluster-at-vizzy-laptop.xml

cluster terminal

or use the desktop shortcut:

cluster desktop

Then, click on More, click on the “vizzy-desktop” checkbox and type roscore in the framebox. Execute the command and close the small window. Finally, click on the ros checkbox and run yarpserver (Run) and yarp run (Run selected) on vizzy’s laptop. Please verify that all the gray boxes have a green checkbox in them.

launch yarp

You can close this window afterwards if you want.

  • yarpmanager (at laptop), graphical interface for running YARP modules

You can execute yarpmanager from the terminal with the following command:

yarpmanager --from robots/vizzy/ymanager.ini

Yarpmanager from terminal

or use the desktop shortcut:

Yarpmanager from desktop

An example of the GUI after issuing the command is in the Figure below. yarpmanager You can see several folders in the Entities box. The only one you will use is the Applications one. After selecting the Applications folder, several Applications will show up. The current files in the vizzy-laptop laptop will display as follows yarpmanager

You can run a YARP module after opening an application window selecting the module and either clicking the Run selected button (green button) or right clicking the module and hitting run. The yarprobotinterface module will initiate the calibration process (the robot will move!):

yarpmanagerun

Depending on the demo you want to run, you will select some of the Modules displayed. You can check the list of required YARP Modules for each demo on each demo section. You need to run the YARP applications before running the roslaunch!.

Arms in rest postion

After running all the necessary yarp modules for your demo issue the following commands in a new terminal:

  simpleClient --robot vizzy --part left_shoulder_arm

Once the application opens write:

  set poss (0 0 0 0 0 0 0 0)
  quit

And for the right arm:

  simpleClient --robot vizzy --part right_shoulder_arm
  set poss (0 0 0 0 0 0 0 0)
  quit

The above commands move the arms to a rest position for navigation.

Running ROS demos.

The desired procedure is to have just one launcher that starts all the needed nodes for the demo (usually this should be done at vizzy-desktop, to avoid as much as possible sending lots of data through the wireless). As mentioned in the previous section, in addition to the roslaunch demo you need to run: (i) icub-cluster and (ii) yarpmanager applications.

Our rule of thumb is to have one launcher file for each demo. Before running a launcher, verify that the Segway is charged and on and all necessary yarp applications are running.

Connect to vizzy-desktop

You should launch demos on vizzy-desktop. Therefore you need to connect to it first either through ssh with:

ssh vizzy@vizzy-desktop

OR mosh with:

mosh vizzy@vizzy-desktop

Mosh connection to vizzy-desktop

We recommend using mosh instead of ssh since it supports intermittent connectivity and roaming. This way, the demo will continue its execution on Vizzy without hanging even if the connection between Vizzy and the laptop is lost. The connection will also recover from losses and even IP changes. This is crucial for environments with a lot of Wi-Fi connections.

ROS demos

As stated before, the rule of thumb is to only run one launch file for each demo. Therefore you should choose ONLY ONE of the following demos:

Base demo with navigation and gaze

Base demo wiki page

Creating and using new map

Creating a new map

Wizard of Oz demo

Wizard of Oz demo

Pedestrian following demo

TODO

Turning Vizzy off

Kill all running applications in the inverse order that they were launched. (Ctrl + C on terminal based applications, and stop button on yarp applications).

After turning everything off turn its time to turn the robot itself off. On a terminal connected to vizzy-desktop through ssh or mosh execute the following:

sudo shutdown -h now

After Vizzy's PC is turned off, turn the segway off (inverse instructions to turn on) and the board switches off. Finally disconnect the battery to power source cable (second image on this page) to make sure Vizzy's battery is not discharging.

Extras

yarpmotorgui

If you need to directly control the torso, head and arm motors you can use the yarpmotorgui. You can execute it in vizzy-desktop (after ssh to vizzy-desktop) or vizzy-laptop with the following command

yarpmotorgui --robot vizzy --context vizzyRobotMotorGui --from vizzy_robot_motor_gui.ini

Running the ball tracker and grasping demo (YARP demo - currently not working)

The ball tracking and grasping requires three yarpmanager applications:

  • Vizzy_Startup_with_ROS
  • Left_Eye_Camera_320x240_for_ball_tracking
  • Ball_Tracking_and_Grasping_for_Vizzy_with_ROS_visual_@_vislab-PORTEGE-R930_both_arms
  • Visualization in rViz. The applications are listed in the execution order, that must be followed. As the name suggests, the first one to double click with the left button of the mouse is Vizzy_Startup_with_ROS. After selecting it with the mouse, you should see the image as follows: You can see several modules on the right side box. The buttons on the top allow you to (from right to left): Help, kill, stop, disconnect, connect, run and refresh. If you push any of those buttons, the corresponding action will be executed on all the modules of the selected application. In the case of Vizzy_Startup_with_ROS, it is better not to run all the modules because of some dependencies that are not implemented yet. Thus, you have to select groups of modules with the mouse or the keyboard, then click the mouse-right-button and select the action. In the figure below you can see an example of some selected modules Running all modules of Vizzy_Startup_with_ROS: The order of the groups is as follows:
  1. robotInterface. Confirm that the power button of the power/control boards is on. After execution, Vizzy should have the head pointing straight forward and the eyes gazing at a very far point (Version and vergence 0). The arms should be symmetric, having the shoulder flexion a bit up (20deg) and the elbow flexion around 40 deg. Please wait until the calibration procedure is finished (i.e. no motor is moving anymore)

Pictures that show Vizzy’s pose after running successfully yarprobotinterface 2. yarpidl_rosmsg. Run them and wait for around 1 sec. 3. vizzyUpperBodyJoints. Run them and wait for around 2 secs. 4. cartesian* modules. Run them and wait for around 5 secs. (This one is not necessary for the following persons demo, just for the ball tracking and grasping) 5. vizzy_iKinGazeCtrl, fixationPointStatusBridge and fixationPointActionBridge. Run them and wait for around 5 secs. Note that you just need to run the modules (no connections needed)

Running all the modules of Left_Eye_Camera_320x240_for_ball_tracking: No groups here needed. Just push the run button and then the connect button.

Running all the modules of Ball_Tracking_and_Grasping_for_Vizzy_with_ROS_visual_@_vislab-PORTEGE-R930_both_arms: No groups here needed. Just push the run button, wait for around 10 secs and then push the connect button. Now if you place the red ball in front of Vizzy’s left camera, the robot should aim at grasping the ball if reachable.

Running visualization in rViz: This will help you to debug, so it is strongly recommended to run. In a terminal at the laptop, type:

rosrun rviz rviz

Then select the visualization file (.rviz) set for the ball tracker demo.

Internet configuration outside of ISR

The router has a slot for a SIM card, so you if you want to use the internet of the SIM card, please execute in vizzy-desktop:

internet_SIM or /home/vizzy-desktop/vizzy-desktop-scripts/connect_to_SIM.sh (Recall that you have to unlock the SIM card in the router interface, http://10.10.1.80)

To go back to the lab configuration, execute in vizzy-desktop:

internet_ISR or /home/vizzy-desktop/vizzy-desktop-scripts/connect_to_ISR.sh (Recall that you have to plug the ethernet cable to the robot)

Troubleshooting

  • Low battery/battery does not charge
  • Segway does not turn on
  • Control boards firmware initialization. Run canLoader
  • Torn power/control cable
  • Fingers are not at home position before the robot is shutdown (either normally or due to a trouble). You need to start the yarprobotinterface program with a configuration file that allows to move the fingers on negative encoder values. Issue the command yarprobotinterface --from yarprobotinterfacecalibfingers.ini, then open the motor control GUI yarpmotorgui by yarpmotorgui --robot vizzy --context vizzyRobotMotorGui --from vizzy_robot_motor_gui.ini and move the finger to the correct home position. Remember to do a power off/power on cycle on the controlboards to reset the encoders.
  • Vizzy-desktop does not boot up properly. There are two known problems:
    • The battery of the motherboard is discharged and the motherboard displays an error related with NVRAM settings before shuts down. Check the error in the error code file. If it is an NVRAM error, change the motherboard battery and restart the computer.
    • After rebooting the disk several times on linux, there is a regular checkdisk that needs user intervention by pushing the key "S" to skip the check. Thus, you need to plug a keyboard before booting vizzy-desktop and wait for around 1 minute and then press the "S" key.
  • If the clocks on vizzy-desktop and a networked device (vizzy-laptop for instance) are not synchronized tf's throw an exception (extrapolation into the future/past). The most successful setup until now, has Vizzy's laptop as an ntp server for Vizzy. To do that follow the following steps:
    1. Install ntpdate on Vizzy and on the laptop: sudo apt install ntpdate && sudo apt install ntp
    2. Edit the configuration file on laptop: sudo vim /etc/ntp.conf and on the last lines of the file add:
    # Allow LAN machines to synchronize with this ntp server
    restrict 10.10.1.80 mask 255.255.255.0 nomodify notrap
    1. Edit the configuration file on Vizzy: sudo vim /etc/ntp.conf and add the following server bellow the list of servers on # Specify one or more NTP servers.:
    pool 10.10.1.82 iburst
    1. Check the clock delay between vizzy-laptop and vizzy-desktop. On vizzy-desktop execute: ntpdate -q 10.10.1.82 The output should be something like server 10.10.1.80, stratum 3, offset -0.001962, delay 0.02850 If the offset is greater than 1ms, you should synchronize the clock with the following commands on vizzy-desktop: sudo service ntp stop ntpdate -q 10.10.1.82 sudo service ntp start

      It might take several trials to succeed.

Horrible pings with wifi

Disable power save!

  iwconfig 2> /dev/null | grep "Power Management"
  Power Management:on
  cd /etc/NetworkManager/conf.d/
  sudo cp default-wifi-powersave-on.conf wifi-powersave-off.conf
  sudo vim wifi-powersave-off.conf

and edit the file contents to:

  [connection]
  wifi.powersave = 2

and then reboot!