USA
Asked — Edited

Ez-Bv4 And Camera With Surface Pro

I'd like to use the 160x120 resolution in my project running ARC (the latest version) for Windows on a Windows 10 Surface Pro 2 but I get the following error:

11/3/2018 11:37:43 AM - Error Camera.SetCaptureImage: AForge.Imaging.UnsupportedImageFormatException: Source pixel format is not supported by the filter. at AForge.Imaging.Filters.BaseTransformationFilter.CheckSourceFormat(PixelFormat pixelFormat) at AForge.Imaging.Filters.BaseTransformationFilter.Apply(BitmapData imageData) at AForge.Imaging.Filters.BaseTransformationFilter.Apply(Bitmap image) at EZ_B.Camera.eihiq5ToKN(Object )

It runs at 320x240 okay but uses a lot of CPU and the image tends to hang or stutter and falls behind when face tracking. Anyone else have issues with the surface pro? The exact same builder file works fine on my laptop (with Windows 7). Thanks:)


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

#57  

Granted I haven't read the entire thread but does the camera and/or project have to run constantly 24hrs a day? Does anyone care at 3am if the camera isn't running? Ok if you need to run 24hrs a day can you not just write a looping script that checks to see if the camera is active (say once a minute or so)? So if it disconnects you can have the script try and re-esablish the connection... Maybe? Again, as mentioned I may be off base as I haven't read the whole thread....

#58  

I use one of these splitters for my hardwired project.

The splitter runs: -ezb usb -camera usb -xbox controller

There has never been an issue with Comm ports

#59  

@ Richard Hey dude, long time. Yeah, I'm afraid it has to run 24/7 for 4 to 6 weeks at a time. If this sculpture is in an art show, as it's supposed to be in January, it may be a long drive, as it is for the upcoming show. I'm very interested in the script you mentioned. I'm slowly learning to manipulate EZB interaction using script but I'm not that advanced. But I have been curious if some code could keep the EZB/camera awake. What might a looping script like that look like?

@56 that sounds pretty good. I'll look into it as a backup but yeah, I'm running out of time. The show quickly approaches.

#60  

Unfortunately I am away from my computer for a few days. I have just the script you are looking for in one of my projects. You could try looking at my public project called My Roli MkII, but it has a lot of stuff in it to dig through. It is a combination of two things. The init script and another keep alive, but I forget what I called it.

I'll post here after the holiday weekend with the details if no one else does first.

Alan

Belgium
#61  

Im not much of a programmer and new to ezb but this should be easy enough. Try this


REPEATWHILE(true)
  IF (IsConnected(0)==false)
    ControlCommand("Connection", Connect0)
  ELSEIF ($IsCameraActive==false)
    ControlCommand("Camera", CameraStart)
  ENDIF
  sleep(3000)
ENDREPEATWHILE

Put that in a custom ezb script and run it. It will check if your board is connected every 3 seconds, and if its disconnect will attempt to reconnect board0. If the camera isnt started it will attempt to start the camera.

You can autostart the above script by giving it a name (I called it watchdog) and adding


ControlCommand("watchdog", ScriptStart)

to the "connection established cmd", so it will run the first time you connect to the board.

Test it by disconnecting your wifi.

You may need to ensure the laptop doesnt try to connect to a different, known wifi when losing the connection with the ezb AP.

#62  

@Mac... This script worked for me in testing (camera only not for the ezb4 itself) ... FYI this script will have to be kept running always as it monitors the camera connection... It will also enable face tracking if need be... Add a script to your project and name it whatever you want... copy and paste my script below into you script...


:top
waitforChange($IsCameraActive)
if($IsCameraActive != 1)
sleep(1000)
ControlCommand("Camera", CameraStart)
sleep(1000)
ControlCommand("Camera", CameraFaceTrackingEnable) #enables face tracking
sleep(1000)
endif
goto(top)
Belgium
#63  

Richard, afaik, if facetracking was enabled it will re-start automatically when the camera is restarted (and if it wasnt enabled, you probably dont want to enable it) Your script also doesnt help if the wifi gets disconnected, which I thought was the OP's main problem.

And ahm..

User-inserted image

:D

#64  

As always, you fellas offer help without chastising or attitude; you're all awesome....to the max:D

Okay, to clear a couple things up;

  1. I thought originally that the problem was the EZB disconnecting, which it was. But.....
  2. The camera disconnects first, followed sometimes by the EZB.
  3. The above is when in AP mode. When I changed to clent with a dedicated router, it was a comm error and the EZB would disconnect. No camera error like in AP mode.

I actually found Alan's loop code late last night (when I remembered I could stop being lazy and search for myself) but the scripts you all shared should prove valuable. Also, and I think this is significant, when I connected last night before going to bed, the camera image on the laptop screen had a lot of horizontal blue lines running through it. That lasted for about two minutes and then cleared up. I'd never seen that until now. Add this to the fact that iRobot ran for weeks on end without disconnecting a year ago, before being stored, now I'm leaning towards a hardware problem. Or possible just the camera cable going bad. I've ordered a new EZB and camera but I think it's time for some major disassembly.