Announcement

Collapse
No announcement yet.

New V5 Vision Sensor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • New V5 Vision Sensor

    Anyone have any info?

  • #2
    Right now, I'm real jealous of the Project Lead the Way teachers that got the sneak peek at the PLTW conference. :-)

    Which I would like to say how impressed I am with PLTW. They're really doing an awesome job from in developing curriculum and programs for teachers to bring STEM into the classroom in a real way. Our school should look into it.

    Comment


    • #3
      I've got my hands on the PLTW kit (270-5826). No documentation whatsoever and the whole internet is silent. This PLTW must be really secretive organization.
      Anyway, what I have gathered so far:
      The camera has 3 ports and a single button
      1. The normal VEX IQ port (I2C). A brain which came in the kit was equipped with firmware v2.1.0.b1 recognizes it as Vision Sensor. A brain with regular v2.0.1 doesn't see anything.
      2. an rj11-like 4-pin jack, I'd assume serial line (for a reason spelled out below)
      3. MicroUSB port

      On the USB, it enumerates as:
      Code:
      [969748.016686] usb 2-1.2: new high-speed USB device number 61 using ehci-pci
      [969748.109575] usb 2-1.2: New USB device found, idVendor=2888, idProduct=0507
      [969748.109579] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [969748.109581] usb 2-1.2: Product: Vision Sensor
      [969748.109583] usb 2-1.2: Manufacturer: VEX Robotics
      [969748.109584] usb 2-1.2: SerialNumber: 276-4850
      and the USB interface is proprietary.

      Anyway, noone is going to do anything like that in vacuum, so I places a bet on CMUcam/pixy. Stock PIXY utilities didn't recognize the camera, but when I hardcoded the aforementioned VID/PID,
      libpixy become happy and tried talking with the camera:
      Code:
      Hello Pixy:
       libpixyusb Version: 0.4
       Pixy Firmware Version: 1.0.6
      Detecting blocks...
      frame 0:
      frame 1:
      frame 2:
      frame 3:
      frame 4:
      frame 5:
      Still not helpful and the pixymon didn't work either. But the button had some effect, so I tried holding it and it apparently "trained" the camera, or maybe switched different modes.
      After that, both VEX Brain device info started showing coordinates, as well as hello_pixy over USB:
      Code:
      frame 1355:
        sig: 1 x: 158 y: 105 width: 316 height: 211
      frame 1356:
        sig: 1 x: 158 y: 105 width: 316 height: 211
      frame 1357:
        sig: 1 x: 158 y: 58 width: 316 height: 116
        sig: 1 x: 223 y: 143 width: 10 height: 7
        sig: 6 x: 141 y: 127 width: 30 height: 21
        sig: 6 x: 107 y: 143 width: 30 height: 8
      So I think I'm getting close to something usable.

      Hey, VEX, the cat is out of the bag, can you share more info on the venerable 276-4850?

      Comment


      • #4
        OK, the I2C protocol is very different from the PIXY and follows the I2C communication patterns of other Vex IQ devices, except it looks like having a banked set of registers.
        The camera reports as sensor type 0x0b (0x02 is motor, then comes LED, light sensor, bumper, gyro and 0x07 is sonar).

        It seems that the camera is able to recognize 7 different classes of objects (likely just as 7 different colors) that you have trained the camera on.
        Then, it reports all (up to 4? more?) the objects of each class. The brain queries each class separately, first by switching the register bank. Let's say my camera is on port 8, thus gets assigned I2C address of 0x22.
        Brain first selects the bank (1) by I2C write to the register 0x24
        Code:
        <start 0x22> 0x24 0x01 0x00 <stop>
        Then, it sets up a read from register 0x26 up and reads (getting "no object" report):
        Code:
        <start 0x22> 0x26 <restart 0x23> 0xff 0xff 0xf0 <stop>
        It then proceeds through other banks to query for other classes. I have had viewport covered by a single green blob, class 6, so:
        Code:
        <start 0x22> 0x24 0x06 0x01 <stop>
        <start 0x22> 0x26 <restart 0x23> 0x00 0x00 0x9e 0xd3 0x00 0x00 0xff 0xff 0xf0 <stop>
        Here, the report says object at 0,0, width: 157, height 211.

        For multiple objects, the report was like:
        Code:
        ... <restart 0x23> 55 13 49 4d 00 00 18 bf 44 14 00 00 87 7a 17 1b 00 00 42 a6 06 0b 00 00 ff ff f0
        (that was 4 objects, I have no idea what the 5th and 6th bytes of each object report mean....)

        With the above, it should be quite easy to implement a camera library using direct i2c messages on a regular firmware.

        I wish I could get the usb interface decoded as well - pixymon didn't work even with fixed PID/VID....

        Comment


        • #5
          I'm pretty excited about this, I have the Pixy that I'm using and I really like that it can do a ton of on-board processing. Thanks Nenik for doing the research on this!
          Last edited by Foster; 11-11-2017, 10:12 AM.

          Comment

          Working...
          X