SIGVerse with Python

The aim of this tutorial is to

To use this tutorial, the use needs to have boost.python libraries installed and configured on his visual studio project. I have shown how to do that in previous tutorial.

When you run this code, it captures 100 mouse movements and captures the relative distance between successive mouse movements. To change the iteration from 100 to some other number, please modify the counter. We shall now be importing this user defined module in our code.

You need to have SigService library on your disk. Please download it from here: I am using SIGService_v2-1-0 and its location on my disk is at F:\Sigverse\SIGService_v2-1-0\SIGService_v2-1-0

        "F:\Sigverse\SIGService_v2-1-0\SIGService_v2-1-0\include";
         C:\Python27\include;
        "C:\Boost\include\boost-1_54"

"F:\Sigverse\SIGService_v2-1-0\SIGService_v2-1-0\lib\Debug"; C:\Python27\libs; C:\Boost\lib\i386

     $(OutDir)\$(ProjectName).sig
           SIGService.lib 
           C:\Python27\libs\python27.lib 
           C:\Boost\lib\i386\boost_python-vc90-mt-gd-1_54.lib

The above code, imports the python module which captures relative positions of mouse movements. Those positions are then sent to Sigserver for moving objects inside Sigviewer.

1. Create a project directory using

         sigcreate.sh  NewProject

2. Copy the following code and name it as LToolController.cpp

3. Create the world file, which has a stick tool and object. Name it as "ToolsOnTable.xml"

4. Please load the world file

    sigserver.sh -w ./ToolsOnTable.xml -p write_your_port_number

5. Go to Services-->Add-->MyServiceTest.sig and then Services-->Start

This shall add your mouse service.

6. Please click "Start" to run the simulation.

7. When you use left click the mouse events are captured and their relative positions are recorded. Based on these relative positions, the tool moves which hits the target object. On making right click, the event capturing is stopped.


Front page   New List of pages Search Recent changes   Help   RSS of recent changes