Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1
Send Topic Print
Two TCP connections to the same port (Read 3216 times)
andrew.kirillov
YaBB Newbies
*




Posts: 33
Two TCP connections to the same port
08/27/09 at 7:26am
 
Hello,
 
I would like to check if it is possible to establish two TCP connections to the same SVS’s port, for example 10001? The reason I ask about this is that I would like to split video requests from motors/servos/etc. requests and control them separately, so I could change motors’ state using one TCP connection while image is downloading over another TCP connection.
 
I did not manage to do this so far, so it seems it does not work this way (once one connection is established, another one simply timeouts with no connection). But maybe there is something what I’ve missed …
 
With best regards,
Andrew
Back to top
 
 
WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Two TCP connections to the same port
Reply #1 - 08/27/09 at 7:34am
 
No - you can only have a single connection per port.  Note that the SRV-1 firmware only sends data in response to a request, so you will interleave requests for images or other commands at the client end of the connection.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
andrew.kirillov
YaBB Newbies
*




Posts: 33
Re: Two TCP connections to the same port
Reply #2 - 08/27/09 at 8:36am
 
Well, in this case it may be an issue in architecture. Even if each port may accept only one connection, then it would be nice to have 3 ports available – 2 for cameras and 1 for motors/servos/etc.
 
Here is what I see as a bottleneck. Suppose we configure SVS to provide 640x480 images (or even bigger) with good quality. Frame rate may go down a lot with such configuration and SVS may become not so responsive. So, at the moment when application may want to stop motors or control servos, it will still need to wait until requested image is received. This means that robot will continue to drive while it should stop. It may lead to a bit unresponsive robot in some real applications.
 
Another issue I see may cause cameras to be out of sync a bit. If we use 10002 port to access one camera and 10001 to access another plus control motors/servos/sensors, then we may get lower FPS on the 10001, since that port may be also busy by doing something else.  
 
Any suggestions on how to make sure that control requests (motors/servos) are not delayed by image responses?
 
With best regards,
Andrew
Back to top
 
« Last Edit: 08/27/09 at 8:36am by andrew.kirillov »  
WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Two TCP connections to the same port
Reply #3 - 08/27/09 at 8:52am
 
You won't see a performance difference between channels because the non-image communication uses so little bandwidth.  Response in higher resolution modes will be more of an issue - it could take 250 milliseconds for the processor the finish compressing and sending a 640x480 image.  To deal with this, you might have to modify the send_frame() function in srv.c to periodically check for incoming characters while transmitting a frame.  Problem is that will mess with the main while(1) getchar() flow, so you will have to think this through.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
NickK1066
Senior Member
****




Posts: 299
Re: Two TCP connections to the same port
Reply #4 - 08/27/09 at 9:34am
 
Quote from andrew.kirillov on 08/27/09 at 8:36am:
Well, in this case it may be an issue in architecture.

 
Not really, even an architecture with synchronous image capture has other issues such as time delays in network transfer and race conditions between the image capture - regardless of the mechanism.
 
Remember the firmware is single threaded and it does not have task switching, nor does the communication protocol support prioritisation or multiplexing.
 
This would be the case even if a third blackfin was used for motor/servo control; or the firmware and protocol were rewritten to support multiplexing/scheduling.
 
The programming needs to work with the real complexities unfortunately.
Back to top
 
« Last Edit: 08/27/09 at 9:34am by NickK1066 »  

  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Two TCP connections to the same port
Reply #5 - 08/27/09 at 10:01am
 
Quote from NickK1066 on 08/27/09 at 9:34am:

Remember the firmware is single threaded and it does not have task switching, nor does the communication protocol support prioritisation or multiplexing.

This would be the case even if a third blackfin was used for motor/servo control; or the firmware and protocol were rewritten to support multiplexing/scheduling.

The programming needs to work with the real complexities unfortunately.

 
And that's why the SRV-1 firmware is based on the simplest architecture path of a single polled program loop without any interrupts.  Any mechanism you select to optimize some aspect of performance will have side effects on other parts of the system.  By using a single polled loop, response times are reasonably predictable and the process is very robust.  The decision to NOT use interrupts with this code is the result of having done a LOT of code development with interrupt driven real time executives and the real-world experience of chasing down non-deterministic program problems.  
 
Back to top
 
« Last Edit: 08/27/09 at 10:02am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pages: 1
Send Topic Print