Propeller2Explorer
rjo__
Posts: 2,114
Propeller2Explorer (very much a work in progress)
Many thanks to our forum experts.
Description: Windows based application stub to support study of the P2/P2v.
Interface created using Processing 3(64bit). P2 interface uses P2Host.spin
License: free for any use, without attribution.
Current Capabilities
Communications... 1 serial line between P2 and P2Explorer, BAUD rates up to 1,225,000.
...at startup, serial communications is not set up. Start P2Host.spin first, then
... configure Propeller2Explorer
External Connections for P2Explorer
1. Kinect V2
Click screen button KINECTV2 to start
Transfer of 8bit depth map (320x240) to P2 ~ 1.5fps
Transfer of (320x240)16bit raw depth data and 8bit gray scale image to P2 ~2sec
This requires Danial Shiffman's library shiffman.net/p5/kinect/
which in turn requires a different driver, which in turn requires 64bit Windows 8.1 or 10, haven't tried 7.
2. USB camera
Transfer rate between USB camera and P2v (320x240 gray) ~1.5fps.
Right now, the program stalls if a camera is not present.
External Connections for P2v
1. Digital Camera... works but limited to OV9655 @~1fps until smart pins are done
P2Explorer Utility Functions
1. On Screen Console for listing of P2 instruction set and general housekeeping.
... P2Explorer expects a text file, named "instructionsv6.txt" in its current directory
... to change this change line #148 of Propeller2Explorer
2. 512 long buffer with graphical interface to show contents of LUT, COG or HUB RAM.
3. Click screen button to Export Kinect data as 24bit color .ply file.
4. keyboard functions
a ... acquire continuously from digital camera (ov9655) and display video
b ... tell P2 to transfer off-screen buffer to screen and display.
... note that once a Kinect data set is transferred, the offscreen buffer is overwritte
...until then you should see a stock foto of our favorite genius:)
c ... transfer cog contents to lut
d ... transfer Kinect 8bit depth map to P2 and display on video
h ... presents dialog asking for hub address and then tells P2 to transfer 512 longs
...beginning at that address to lut beginning at lut address #0. To view results press "r"
...For some reason hidden in the depths of Processing 3, the first time this is called, the
...dialog shows up behind the main window. After that, it is ok.
i ... transfer usb camera to P2 and display video
k ... transfer Kinect 8bit gray image and 16 bit depth data to P2 and display gray image
r ... read lut from P2 and transfer to LUT array in P2Explorer
... contents viewable at bottom of screen using scroll bar.
s ... retrieves a cog object file, sends that file to P2. The P2 then loads the file into the Hub
... and starts the cog. Right now, you have to edit line #983 in Propeller2Explorer to establish
... the location and name of the cog object:
... String path = "C:/Users/Public/p2/all_cogs_blinkexp.obj";
t ... transform kinect data and display (not done)
comments... very messy. I'll clean it up later;)
... I inadvertently commented out my P2 button function. If you uncomment the 5 lines at the beginning of loop1
then by pushing button PB0, the P2 will request an image from the USB camera and display it in the video
Many thanks to our forum experts.
Description: Windows based application stub to support study of the P2/P2v.
Interface created using Processing 3(64bit). P2 interface uses P2Host.spin
License: free for any use, without attribution.
Current Capabilities
Communications... 1 serial line between P2 and P2Explorer, BAUD rates up to 1,225,000.
...at startup, serial communications is not set up. Start P2Host.spin first, then
... configure Propeller2Explorer
External Connections for P2Explorer
1. Kinect V2
Click screen button KINECTV2 to start
Transfer of 8bit depth map (320x240) to P2 ~ 1.5fps
Transfer of (320x240)16bit raw depth data and 8bit gray scale image to P2 ~2sec
This requires Danial Shiffman's library shiffman.net/p5/kinect/
which in turn requires a different driver, which in turn requires 64bit Windows 8.1 or 10, haven't tried 7.
2. USB camera
Transfer rate between USB camera and P2v (320x240 gray) ~1.5fps.
Right now, the program stalls if a camera is not present.
External Connections for P2v
1. Digital Camera... works but limited to OV9655 @~1fps until smart pins are done
P2Explorer Utility Functions
1. On Screen Console for listing of P2 instruction set and general housekeeping.
... P2Explorer expects a text file, named "instructionsv6.txt" in its current directory
... to change this change line #148 of Propeller2Explorer
2. 512 long buffer with graphical interface to show contents of LUT, COG or HUB RAM.
3. Click screen button to Export Kinect data as 24bit color .ply file.
4. keyboard functions
a ... acquire continuously from digital camera (ov9655) and display video
b ... tell P2 to transfer off-screen buffer to screen and display.
... note that once a Kinect data set is transferred, the offscreen buffer is overwritte
...until then you should see a stock foto of our favorite genius:)
c ... transfer cog contents to lut
d ... transfer Kinect 8bit depth map to P2 and display on video
h ... presents dialog asking for hub address and then tells P2 to transfer 512 longs
...beginning at that address to lut beginning at lut address #0. To view results press "r"
...For some reason hidden in the depths of Processing 3, the first time this is called, the
...dialog shows up behind the main window. After that, it is ok.
i ... transfer usb camera to P2 and display video
k ... transfer Kinect 8bit gray image and 16 bit depth data to P2 and display gray image
r ... read lut from P2 and transfer to LUT array in P2Explorer
... contents viewable at bottom of screen using scroll bar.
s ... retrieves a cog object file, sends that file to P2. The P2 then loads the file into the Hub
... and starts the cog. Right now, you have to edit line #983 in Propeller2Explorer to establish
... the location and name of the cog object:
... String path = "C:/Users/Public/p2/all_cogs_blinkexp.obj";
t ... transform kinect data and display (not done)
comments... very messy. I'll clean it up later;)
... I inadvertently commented out my P2 button function. If you uncomment the 5 lines at the beginning of loop1
then by pushing button PB0, the P2 will request an image from the USB camera and display it in the video
Comments
I've read through that thing a few times and I think I get the gist of it.
From PC to P2 is nice at 3MBaud. 250 milliseconds for the same file.
Digital camera capture is a breeze. Unfortunately, the only cameras I can find right now come from a bag of tested units that I partially destroyed. Have no idea what I did with my good bag:)
This is 320x240 grayscale from an OV9655, but I don't see why we couldn't do color at 640x480 and somewhat beyond. To get this I used a 40MHz clock to drive the OV9655. I believe it then divides this down to a 20MHz pixel clock. I still need to verify this, but I believe it to be correct.
I'm looking forward to hooking up a couple of PropCams and see 100 FPS!!!
I have nearly stamped out the issue of the Processing sketch occasionally failing to launch after a normal exit. I haven't seen it for a couple of days now.
I leave the sketch open continuously and it doesn't seem to cause any problems. If I have enough other applications open and leave it long enough, the Win 10 graphics driver begins to fail. But as long as I am reasonable, no problems. To get the best serial performance, I have the Prop 2v hooked into the USB3 port of my cheapo Kangaroo... so that other USB functions don't have a chance to interfere. USB3 is also where the KinectV2 is usually connected... so for now, no KinectV2 in the mix.
I did my best to be flattering.
Not even an "I don't know."
Thanks to Brian.
Still working on PropCam... The new Smartpin monitor mode that Brian suggested should help a lot.
1: PropCam (of a Walmart Hubman package),
2: LeapMotion IR stereo fisheye(inside a drawer).
3: shows the stereo-matched points in white of drawer and edge of desk.
The LeapMotion unit is the cheapest source of quality stereo images that I can find(available for about $30).
The >150 degree field of view was unexpected and has me thinking;)
I'm still working on the PropCam implementation... currently just to make sure everything works the way I think it does, I have a simple wrbyte ina loop to capture all of the inputs and a subsequent analysis to derive the actual image data. The global shutter means that motion blur is a thing of the past. I'm kind of surprised that with the large pixels, the unit isn't more sensitive.
I need to solve an issue with serial and then I'll be posting an update.