robotraconteur-contrib / cognex_robotraconteur_driver

0 stars 2 forks source link

Connecting with Cognex Camera #1

Open asigisrit opened 10 months ago

asigisrit commented 10 months ago

Hi, I am trying to connect to a Cognex Camera using Robot Raconteur. I am getting the following error when I run Cognex_objdet.py. I would appreciate any suggestions you have Thanks

Traceback (most recent call last): File "c:\Users\asigis\AppData\Local\miniconda3\envs\rr_training_sim\examples\Cognex_driver\Cognex_objdet.py", line 118, in with RR.ServerNodeSetup("cognex_Service", 52222) as node_setup: File "C:\Users\asigis\AppData\Local\miniconda3\envs\rr_training_sim\lib\site-packages\RobotRaconteur\RobotRaconteurPythonUtil.py", line 5314, in init super(ServerNodeSetup, self).init(node_name, tcp_port, RobotRaconteurPython.RobotRaconteurNodeSetupFlags_SERVER_DEFAULT, File "C:\Users\asigis\AppData\Local\miniconda3\envs\rr_training_sim\lib\site-packages\RobotRaconteur\RobotRaconteurPythonUtil.py", line 5135, in init self.__setup = RobotRaconteurPython.WrappedRobotRaconteurNodeSetup(node, node_name, tcp_port, flags, allowed_overrides, File "C:\Users\asigis\AppData\Local\miniconda3\envs\rr_training_sim\lib\site-packages\RobotRaconteur\RobotRaconteurPython.py", line 11043, in init _RobotRaconteurPython.WrappedRobotRaconteurNodeSetup_swiginit(self, _RobotRaconteurPython.new_WrappedRobotRaconteurNodeSetup(*args)) Exception: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted [system:10048] PS C:\Users\asigis\AppData\Local\miniconda3\envs\rr_training_sim\examples\Cognex_driver>

johnwason commented 10 months ago

It looks like something else is listening on port 52222. You can modify the port using the --robotraconteur-tcp-port command line option:

python Cognex_objdet.py --robotraconteur-tcp-port=22232

You will need to modify the connection URL to use the different port if you are not using autodiscovery:

rr+tcp://localhost:22232?service=cognex

asigisrit commented 10 months ago

Hi John, Thanks for your suggestions, but it is not working yet. Let me explain my setup to make sure I'm doing the right thing. I have a Cognex IS2000 camera hooked up to my PC network, that I can access using Cognex Insight software. I can also capture and download images using python combination of telnet and ftp commands, so the connectivity is working.

I have Robot Raconteur downloaded and am able to use gazebo simulation and access webcam in the client service mode as illustrated in the example.

Now when I try to access the Cognex camera from RR, is Cognex_objdet.py the right file to start the service? If so there is a host IP address in line 12, is that the IP address of the camera? Do you have any step by step instruction documented as you have for the webcam and irobot.

My eventual goal is to have a common interface for my UR and ABB robots in addition to the Cognex vision system, talking to Cognex is the 1st step. Many Thanks Abu

johnwason commented 10 months ago

@hehonglu123 can you help?

hehonglu123 commented 10 months ago

Hi Abu,

We have used this driver for IS7802 with Cognex's built-in object detection. There is a chance it's compatible to IS2000 series, but first let me explain our setup.

We used Cognex In-Sight Explorer (EasyBuilder) to train the object within ROI, and Cognex will continuously detect and identify bounding box(es) of the trained object(s) if there's any. In terms of communication, we set up Cognex (in In-Sight Explorer) to formulate object data into a String through socket connection to PC, and this driver parses that string self.c.recv(1024).decode("utf-8") into object data.

If this sounds similar to your goal, I can write up a detailed instruction on Cognex set-up and string parsing.

asigisrit commented 10 months ago

Hi Honglu, Thanks for your response. Yes, your description sounds very similar to what we want to achieve. I would appreciate if you could send me detailed instructions.

hehonglu123 commented 10 months ago

Just updated some instructions for Cognex setup. It's not generalized, depending on how users want to send the data there're multiple ways to format the message. From that point you can test with python socket to test the output from Cognex, and modify the RR service as needed.

asigisrit commented 10 months ago

Hi Honglu, I can only see EasyView and FTP options under Communications as shown in the attached screen shot. I don’t see TCPIP option as per your example. Please advise Thanks Abu

Abu Islam, Ph.D. Research Associate Professor Golisano Institute for Sustainability Rochester Institute of Technology 190 Lomb Memorial Dr. Rochester, NY 14623 W: 585-475-4246 C: 585-802-5301 @.**@.> [RIT | Rochester Institute of Technology]https://www.rit.edu/

CONFIDENTIALITY NOTICE: The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

From: Honglu He @.> Sent: Thursday, November 2, 2023 9:43 PM To: robotraconteur-contrib/Cognex_driver @.> Cc: Abu Islam @.>; Author @.> Subject: Re: [robotraconteur-contrib/Cognex_driver] Connecting with Cognex Camera (Issue #1)

Just updated some instructions for Cognex setup. It's not generalized, depending on how users want to send the data there're multiple ways to format the message. From that point you can test with python socket to test the output from Cognex, and modify the RR service as needed.

— Reply to this email directly, view it on GitHubhttps://github.com/robotraconteur-contrib/Cognex_driver/issues/1#issuecomment-1791786889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDUSN5UGIW7GLRMI4O75LPTYCRD2PAVCNFSM6AAAAAA6YCPD3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRG44DMOBYHE. You are receiving this because you authored the thread.Message ID: @.**@.>>

asigisrit commented 10 months ago

Thanks for the update

I can only see EasyView and FTP options under Communications as shown in the attached screen shot. I don’t see TCPIP option as per your example. Please advise

asigisrit commented 10 months ago

Please ignore the previous comment, got that part

asigisrit commented 9 months ago

Hi Honglu, I am still having problem connecting with a cognex camera. Please see below a screenshot of when I start the service. When I start the client it says service not found. As per John, the service is not properly starting. Can we get on to a zoom call to discuss? Thanks Abu

@.***

Abu Islam, Ph.D. Research Associate Professor Golisano Institute for Sustainability Rochester Institute of Technology 190 Lomb Memorial Dr. Rochester, NY 14623 W: 585-475-4246 C: 585-802-5301 @.**@.> [RIT | Rochester Institute of Technology]https://www.rit.edu/

CONFIDENTIALITY NOTICE: The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

From: Honglu He @.> Sent: Thursday, November 2, 2023 9:43 PM To: robotraconteur-contrib/Cognex_driver @.> Cc: Abu Islam @.>; Author @.> Subject: Re: [robotraconteur-contrib/Cognex_driver] Connecting with Cognex Camera (Issue #1)

Just updated some instructions for Cognex setup. It's not generalized, depending on how users want to send the data there're multiple ways to format the message. From that point you can test with python socket to test the output from Cognex, and modify the RR service as needed.

— Reply to this email directly, view it on GitHubhttps://github.com/robotraconteur-contrib/Cognex_driver/issues/1#issuecomment-1791786889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDUSN5UGIW7GLRMI4O75LPTYCRD2PAVCNFSM6AAAAAA6YCPD3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRG44DMOBYHE. You are receiving this because you authored the thread.Message ID: @.**@.>>

aislam2020 commented 9 months ago

Here is the screenshot Cognex_rr_screenshot

aislam2020 commented 9 months ago

I will send a zoom meeting notice for next week, thanks