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 2 
Send Topic Print
SDL-based stereo console (Read 15204 times)
spikey
YaBB Newbies
*




Posts: 43
Re: SDL-based stereo console
Reply #15 - 12/10/08 at 8:20am
 
I think I might have solved the occasional problem with lockups in the SDL console (C-version, converted to single camera), here's my code to receive the image (no lockups for a whole day):
 
Code:
// look for frames
while (!imageReady) {	
	if (!imageReady) {
		nrSocketsReady = SDLNet_CheckSockets(socSet, TIMEOUT);
		if (nrSocketsReady == -1) {
			printf("SDLNet_CheckSockets: %s\n", SDLNet_GetError());
			perror("SDLNet_CheckSockets");
		}
		else if (nrSocketsReady > 0) {
			if (SDLNet_CheckSockets(socSet, TIMEOUT)) {
				if (SDLNet_SocketReady(socSet)) {
					result = SDLNet_TCP_Recv(tcpsock, buf, MTU);
					memcpy(imageBuf+index, buf, result);
					index += result;
					if ((buf[result-2] == -1) && (buf[result-1] == -39))
						imageReady = 1;
				}
			}
		}
		else {
			printf("\n\rNo sockets ready.\n\r");
			break;
		}
	}
} 


 
If there's a timeout, the current frame will be skipped, and no update will occur until the request of a new frame.
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: SDL-based stereo console
Reply #16 - 12/10/08 at 11:17am
 
Thanks for posting this.  I modified the stereo version to incorporate your changes -
    http://www.surveyor.com/stereo/stereo.c
 
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
spikey
YaBB Newbies
*




Posts: 43
Re: SDL-based stereo console
Reply #17 - 12/15/08 at 6:44am
 
I've added support for sending commands directly through the SDL console to the SRV (single camera) and the reply is printed in the linux console. The full source and a make script can be downloaded HERE.
 
Any comments or questions are very welcome!
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: SDL-based stereo console
Reply #18 - 12/15/08 at 7:33am
 
Thanks for posting this.  I'll add a link to this along with the other consoles.
 
The Google code hosting looks pretty convenient.  It's probably time to move our SVN server for the SRV-1 firmware and java consoles to Google hosting.
Back to top
 
 

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