loading
 
API Crash (Python)
Franklin  [23 posts]
8 years

Hello,

I’m trying to use the Python API.  I’m trying to get the test program in RR_API.py running.  The following is what happens:
1)    Edit RR_API test program to point to files on my system.
2)    Start the API server (6060, Time Out 0,1 or 3 seconds, Threads 1)
3)    Start Python and import RR_API
Result:
-    RR puts shows an error with a missing file name (the file is present)
-    After a couple of seconds Python returns an error from readMessage
If you click OK on the error pop up RR will crash (output is below along with RR_API edits).  



Franklin  [23 posts] 8 years
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="RoboRealm.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="1394camera.dll" SIZE="176208" CHECKSUM="0x2F845F20" BIN_FILE_VERSION="6.4.4.128" BIN_PRODUCT_VERSION="6.4.4.128" PRODUCT_VERSION="6.04.04.0128" FILE_DESCRIPTION="1394 Digital Camera Interface DLL" COMPANY_NAME="CMU Robotics Institute" PRODUCT_NAME="1394 Digital Camera" FILE_VERSION="6.04.04.0128" ORIGINAL_FILENAME="1394CAMERA.DLL" INTERNAL_NAME="1394CAMERA.DLL" LEGAL_COPYRIGHT="Copyright (C) CMU 2000-2006" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.4.4.128" UPTO_BIN_PRODUCT_VERSION="6.4.4.128" LINK_DATE="12/13/2006 14:17:23" UPTO_LINK_DATE="12/13/2006 14:17:23" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="FreeImage.dll" SIZE="1089536" CHECKSUM="0xE4CF5A52" BIN_FILE_VERSION="3.9.2.0" BIN_PRODUCT_VERSION="3.9.2.0" PRODUCT_VERSION="3, 9, 2, 0" FILE_DESCRIPTION="FreeImage library" COMPANY_NAME="FreeImage" PRODUCT_NAME="FreeImage" FILE_VERSION="3, 9, 2, 0" ORIGINAL_FILENAME="FreeImage.dll" INTERNAL_NAME="FreeImage" LEGAL_COPYRIGHT="Copyright © 2003-2006 by FreeImage" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="3.9.2.0" UPTO_BIN_PRODUCT_VERSION="3.9.2.0" LINK_DATE="10/29/2006 17:19:15" UPTO_LINK_DATE="10/29/2006 17:19:15" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Hooks.dll" SIZE="28672" CHECKSUM="0x7D99E31E" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/13/2009 06:38:01" UPTO_LINK_DATE="02/13/2009 06:38:01" />
    <MATCHING_FILE NAME="inpout32.dll" SIZE="32768" CHECKSUM="0x47EE9529" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="inpout32" COMPANY_NAME="http://www.logix4u.net" PRODUCT_NAME="inpout32" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="inpout32.dll" INTERNAL_NAME="inpout32" LEGAL_COPYRIGHT="Freeware" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="07/22/2003 16:34:07" UPTO_LINK_DATE="07/22/2003 16:34:07" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Phantom.dll" SIZE="122880" CHECKSUM="0x98C167C9" BIN_FILE_VERSION="0.2.0.9" BIN_PRODUCT_VERSION="0.2.0.9" PRODUCT_VERSION="0, 2, 0, 9" FILE_DESCRIPTION="Phantom (Spirit.ocx Replacement)" COMPANY_NAME="Fenestra Software LLC" PRODUCT_NAME="Phantom (Spirit.ocx Replacement)" FILE_VERSION="0, 2, 0, 9" ORIGINAL_FILENAME="Phantom.DLL" INTERNAL_NAME="Phantom" LEGAL_COPYRIGHT="Copyright 2002 Fenestra Software LLC Portions Copyright (C) 1998, 1999 Kekoa Proudfoot" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.2.0.9" UPTO_BIN_PRODUCT_VERSION="0.2.0.9" LINK_DATE="12/18/2006 07:33:59" UPTO_LINK_DATE="12/18/2006 07:33:59" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="RoboRealm.exe" SIZE="4997120" CHECKSUM="0xA8DB9703" BIN_FILE_VERSION="2.5.4.0" BIN_PRODUCT_VERSION="2.5.4.0" PRODUCT_VERSION="2, 5, 4" FILE_DESCRIPTION="RoboRealm" COMPANY_NAME="RoboRealm" PRODUCT_NAME="RoboRealm" FILE_VERSION="2, 5, 4" ORIGINAL_FILENAME="RoboRealm.exe" INTERNAL_NAME="RoboRealm" LEGAL_COPYRIGHT="Copyright © 2009" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.5.4.0" UPTO_BIN_PRODUCT_VERSION="2.5.4.0" LINK_DATE="08/25/2009 02:24:07" UPTO_LINK_DATE="08/25/2009 02:24:07" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="RR_COM_API.dll" SIZE="86016" CHECKSUM="0xF4C2BDC3" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="RR_COM_API Module" COMPANY_NAME="" PRODUCT_NAME="RR_COM_API Module" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="RR_COM_API.DLL" INTERNAL_NAME="RR_COM_API" LEGAL_COPYRIGHT="Copyright 2006" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="02/27/2009 05:53:29" UPTO_LINK_DATE="02/27/2009 05:53:29" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="ScriptSite.dll" SIZE="110592" CHECKSUM="0x6EED881" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="ScriptSite Module" COMPANY_NAME="" PRODUCT_NAME="ScriptSite Module" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="SCRIPTSITE.DLL" INTERNAL_NAME="SCRIPTSITE" LEGAL_COPYRIGHT="Copyright 1997" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="07/12/2009 19:04:01" UPTO_LINK_DATE="07/12/2009 19:04:01" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="uninstall.exe" SIZE="36910" CHECKSUM="0x8C1F47C6" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="02/21/2009 19:46:39" UPTO_LINK_DATE="02/21/2009 19:46:39" />
    <MATCHING_FILE NAME="Examples\RR_COM_API.dll" SIZE="86016" CHECKSUM="0xF4C2BDC3" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="RR_COM_API Module" COMPANY_NAME="" PRODUCT_NAME="RR_COM_API Module" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="RR_COM_API.DLL" INTERNAL_NAME="RR_COM_API" LEGAL_COPYRIGHT="Copyright 2006" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="02/27/2009 05:53:29" UPTO_LINK_DATE="02/27/2009 05:53:29" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Examples\ScriptSite.dll" SIZE="110592" CHECKSUM="0x6EED881" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="ScriptSite Module" COMPANY_NAME="" PRODUCT_NAME="ScriptSite Module" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="SCRIPTSITE.DLL" INTERNAL_NAME="SCRIPTSITE" LEGAL_COPYRIGHT="Copyright 1997" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="07/12/2009 19:04:01" UPTO_LINK_DATE="07/12/2009 19:04:01" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="Plugins\SwapColor.dll" SIZE="28672" CHECKSUM="0x70C8A050" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1, 0, 0, 1" FILE_DESCRIPTION="RRModule DLL" COMPANY_NAME="" PRODUCT_NAME="RRModule Dynamic Link Library" FILE_VERSION="1, 0, 0, 1" ORIGINAL_FILENAME="RRModule.DLL" INTERNAL_NAME="RRModule" LEGAL_COPYRIGHT="Copyright (C) 2005" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="02/06/2009 02:52:27" UPTO_LINK_DATE="02/06/2009 02:52:27" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="989696" CHECKSUM="0x7D737C09" BIN_FILE_VERSION="5.1.2600.5512" BIN_PRODUCT_VERSION="5.1.2600.5512" PRODUCT_VERSION="5.1.2600.5512" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.5512 (xpsp.080413-2111)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xF44A2" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.5512" UPTO_BIN_PRODUCT_VERSION="5.1.2600.5512" LINK_DATE="04/14/2008 00:11:24" UPTO_LINK_DATE="04/14/2008 00:11:24" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>
Franklin  [23 posts] 8 years
Here is a screen image.


Anonymous 8 years
Franklin,

Thanks for the error report. There was a problem in the way the test script would quickly change image sizes. We've fixed it but you probably still want to remove the

rr.GetImage and rr.setImage

as that switches the size to 320x240 without needing to. So a minimal test for you would be

# initialize the API class
rr = RR_API()
width = 0
height = 0

#connect to RoboRealm
rr.Connect("localhost")

# get and print current image dimension
width, height = rr.GetDimension()
print "Width: ",width,"Height: ",height

rr.SetCamera("off")
rr.LoadImage("", "c:\\temp\\err_square_test.jpg")

rr.LoadProgram("c:\\temp\\Negative.robo")

rr.SaveImage("c:\\temp\\py_apidemo.jpg")

rr.close()

Note that the above \s should be doubled up as they are an escape sequence.

We fixed the issue that we saw due to this and the error after the click on the OK button after the bad filename is displayed. If you can download 2.5.7 it should cooperate better with your script. Let us know if this fixes your issues or not.

Thanks!
STeven.
Anonymous 8 years
Oh, and the reason for the bad file name is

c:\\work\rr\\rr_square_test.jpg

is not

c:\\work\\rr\\rr_square_test.jpg

i.e. you are missing a \ before the first rr.

STeven.
Franklin  [23 posts] 8 years
Hello,


I updated to 2.5.7 but it still seems to fail.  Every command returns: "RuntimeError: socket connection broken".  Is there something simple I am doing wrong?

C:\work\rr\API\API\Python>python
Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit (Inte
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from RR_API import *
>>> rr = RR_API()
>>> w, h = rr.GetDimension()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

>>> rr.Connect("localhost")
>>> rr
<RR_API.RR_API instance at 0x00CA38C8>
>>> rr.Connect
<bound method RR_API.Connect of <RR_API.RR_API instance at 0x00CA38C8>>
>>> rr.SetCamera("off")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "RR_API.py", line 191, in SetCamera
    if (self.readMessage() == "<response>ok</response>"):
  File "RR_API.py", line 62, in readMessage
    raise RuntimeError, "socket connection broken"
RuntimeError: socket connection broken
>>>

Anonymous 8 years
Franklin,

Yes, it does seem that something simple is going wrong. Ensure that the timeout of the API is set to 0 and then when running try telnettting to the port directly from a command prompt using

telnet localhost 6060

and see if it just exits or clears the screen in wait for some input.

The errors above just seem that no connection can be made ... are you sure you firewall settings are allowing for this connection?

STeven.
Anonymous 8 years
Hello,

I made sure the timeout was set to zero and turned off the anti-virus stuff.  It seems to work now.

-Franklin

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index