Skip to content

Startup configuration

milanjelisavcic edited this page Aug 3, 2016 · 1 revision

Startup configuration

To run the application you need to run

  • the localizion server
  • the mating server
  • the robots

Localization server startup

Choose the computer you want to run the this server and type down the address, you'll need it for the robots later. Make sure the computer you choose is powerful enought, since running this program is quite an intensive task.

reacTIVision

First you have to run reactivision, folliwing these steps

  • attach the top-view camera to the computer
  • setup the camera resolution to the maximum in the xml configuration file of reacTIVision
  • start reacTIVision

reacTIVision configuration

ReacTIVision is reading a configuration file that should be called @reacTIVision.xml@ from the folder which is lanched from. In this configuration you can change several settings, including the webcam capturing resolution. To change the webcam capturing resolution make sure that in the @reacTIVision.xml@ file there is this line inside the @@ tag:


If you installed the application on the mac, those files can be found in @reacTIVision.app/Contents/Resources/reacTIVision.xml@ whereever you installed the application.

Here is an example of the entire file:

    
    
    
    
    
    
    

Next, create the file @camera.xml@ in the same location (if not already present) and use this configuration:

    
        
        
        
    

Some settings are changed automatically from the program. What you are expecially interested in are the @width@, @height@ and @fps@ properties in the @@ tag.

h4. reacTIVision troubleshooting

Follow these steps if you have troubles with the camera settings (everything too bright or too dark):

  • with the reacTIVision window active, press o. It will open a popup window (on mac) or just an overlay with options (on linux).
  • set up the exposure to manual
  • you have to set the camera options to something optimal. the values you want to tamper with are mainly exposure time and sharpness.

If you are still using the camera from the first setup, notice that all the right part of the field of view is blurred. The camera is faulty.

Localization fitness server

We are assuming that you already compiled and installed the program. _Disclaimer: This description will soon change and include build and install instructions due to improvements in the project structure._

Make sure that the TCP port @7890@ is not used. Then start the program:

robot_localization

The program doesn't need to be installed, it can also be started from the build directory

Mating server startup

There are 2 basic components in starting the mating server:

  • The network connection
  • The mating server daemon

The network connection is currently a hardcoded string in +network.py+, and this is highly inadvisable. It will be parameterized in future versions. In the computer that is going to run the mating server, run:

ifconfig

which will give you its local IP. Use this in the TCP_IP setting.

Now from the root of the project run:

cd Mating
pip3 install -e . --update

to update the packages.

Guess what. The way to start the server is also bad. In order to get the mating server running, navigate to the test directory mating/test/server, and run the mating server daemon like so:

cd mating/test/server
python3 run.py

The server should start accepting TCP packets by the mating robots.

_Disclaimer: This description will soon change due to improvements in the project structure._

Robots

The problem in starting the robots is that you may want to test if everything is connected and working before starting the brain. _Disclaimer: This description will soon change due to improvements in the project structure._

h4. Installing

First downlload the project:

git clone [email protected]:ci-group/robot-baby.git

probably you want to select the @develop@ branch (command @git checkout develop@)

RobotController

You don't need to do anything to install it

Mating

TODO

h5. localization tester

cd robot_localization
gcc -o client-test client-test.c
pigpiod

download, compile install and activate at startup (TODO improve)

Starting

Test

First thing make sure everything is working:

  • connection to the localization server
./client-test $(IP_ADDRESS) 7890 3 $(ROBOT_ID)
  • connection with the mating server
TODO
  • test the servos are working
python3 control_servos.py center 1 2 3 4 5 6 ... # use the real servo pin numbers

Test if all the servos are centered and sturdy then you can shut it off

python3 control_servos.py off 1 2 3 4 5 6 ... # use the real servo pin numbers
Start

If everything is in place, go into the @robot-baby/RobotController@ folder and type:

sudo python3 main.py

If you want to save the output to a log, then type

sudo python3 main.py | tee run.log

@tee@ is a program that will take the input and duplicate the output to @stdout@ and a file

Shutdown

In order to shut down you have to execute the following commands: to stop the execution:

CTRL-Z 

sends SIGTERM to all python3 programs (be carefull, about the all part)

sudo killall python3 

to shut down the servos (otherwise they keep steady in position)

python3 control_servos.py off 1 2 3 4 5 6 ... # use the real servo pin numbers

to continue the execution so that the program can exit

fg
_________________
/ Premature      \
| optimization   |
| is the root of |
| all evil.      |
|                |
\ -- D.E. Knuth  /
-----------------
    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
Clone this wiki locally