OpenMV on Makeblock mbot2?


I’m new to robotics and diving into this together with my 7y old. I’m comfortable with programming software, the hardware part is really new to me.
We got a Makeblock mbot2, which runs on a Cyberpi (customized raspberry pi). It would be amazing to be able to add an openMV camera to the robot. But before I invest in the cam, I would like to know 1. if it’s possible and 2. what is more or less required for this to work?

The mbot2 should be able to take third party sensors and I could write a new extension so it’ll work on mblock (scratch based IDE). I’d love to make this OS if I ever get so far. Not sure if there is another layer that still needs to be programmed or can I access the openMV cam from the extension already?
The pocket shield is outputting 5V so I suppose that won’t be an issue?
From chat I’ve already been adviced to use the UART interface (so that just means using the right cable?)

Any pointers would be really appreciated

This sounds like an interesting project. However, the cyberpi isn’t really similar to a raspberry pi, as it runs off of a microcontroller and is not a single board computer like the raspberry pi. (I think the reason why it is called “CyberPi” is because it is meant to be programmed in python). It would probably be difficult to use the openMV Cam with a CyberPi. However, you could just buy the CyberPi smart camera add on, which is more compatible with the CyberPi. Besides, The OpenMV Cam would add an extra microcontroller, and you would probably only need one microcontroller (the CyberPi) for a camera robot or whatever else you want to build.

Thanks for the input!

I looked at the Makeblock smart camera and found that it’s very limited in functionality. Found out about openCV but realized soon that I would need an actual Raspberry Pi for that, don’t think a webcam + openCV would work on the mbot2.

This led me to the Pixy1/2, which has been integrated with the mbot1. After this, it basically came down to finding the Huskylens and openMV cams, which the openMV seem to be the more powerful option. I’d love to be able to do object and face recognition…

My understanding was that all the processing is done on the openMV cam, thus you can just send the data you need to the cyberpi? So all of it should be lightweight. But I am making assumptions so might be really wrong on this.

This is the python code for the Makeblock smart camera. Would integrating the openMV cam be as simple as writing similar code and boom, it works? Or is that naive?

class smart_camera_c():

    def get_count(self, index = 1):
        return module_auto.common_request("2f97d006cd234ec9b57b0fc057dc962a", ( index ) , 30)

    def reset_count(self, index = 1):
        return module_auto.common_request("eff0ae01f00da114b0a4e8a160d3a132", ( index ) , 30)

    def set_mode(self, mode = "color", index = 1):
        return module_auto.common_request("9d7abe2f06cec422dff12afa1573aff9", ( mode , index ) , 30)

    def learn(self, sign = 1, t = "until_button", index = 1):
        return module_auto.common_request("fd716bc55bc291dadbdf05b9d179ae86", ( sign , t , index ) , 30)

    def detect_sign(self, sign, index = 1):
        return module_auto.common_request("da615504bdc03415d631e5ddd5f972f0", ( sign, index ) , 30)

    def detect_sign_location(self, sign, location, index = 1):
        return module_auto.common_request("d6335a4860fb122bd1e7e226aab4f596", ( sign, location, index ) , 30)

    def get_sign_x(self, sign, index = 1):
        return module_auto.common_request("ac811c338a185ca49d59f6061ff2dd18", ( sign, index ) , 30)

    def get_sign_y(self, sign, index = 1):
        return module_auto.common_request("555029a1cd05ab74f3ea0b6c5d44b0fb", ( sign, index ) , 30)

    def get_sign_wide(self, sign, index = 1):
        return module_auto.common_request("7a475b314472cfae51e12a9f97f078ce", ( sign, index ) , 30)

    def get_sign_hight(self, sign, index = 1):
        return module_auto.common_request("020210412e159546ce82c894664b6ed6", ( sign, index ) , 30)

    def open_light(self, index = 1):
        return module_auto.common_request("afd44209e8067ef506dd85f9c345abf9", ( index ) , 30)

    def close_light(self, index = 1):
        return module_auto.common_request("154afee2304de997ba7343fd960ceeb0", ( index ) , 30)

    def reset(self, index = 1):
        return module_auto.common_request("70fd6fcff886c22176d599d6b506e493", ( index ) , 30)

    def detect_label(self, label, index = 1):
        return module_auto.common_request("d55a71fa1ed7b80220016592e00cc7f0", ( label, index ) , 30)

    def get_label_x(self, label, index = 1):
        return module_auto.common_request("9a8973f53e5783263355c94311146448", ( label, index ) , 30)

    def get_label_y(self, sign, index = 1):
        return module_auto.common_request("be366580dd45813ec6c0dad478731ea8", ( sign, index ) , 30)

    def detect_cross(self, index = 1):
        return module_auto.common_request("0338fc84ad81df76160c7f3ee5efd71f", ( index ) , 30)

    def get_cross_x(self, index = 1):
        return module_auto.common_request("f4c2cb62a83d627683d7de5f382fce35", ( index ) , 30)

    def get_cross_y(self, index = 1):
        return module_auto.common_request("22733eeb612edd5194e9616c6d362dc6", ( index ) , 30)

    def get_cross_road(self, index = 1):
        return module_auto.common_request("11d79e2df0a20d650dd4a9faad3a8b12", ( index ) , 30)

    def get_cross_angle(self, sn = 1, index = 1):
        return module_auto.common_request("31f690b956d796d8acc1171a955c1073", ( sn , index ) , 30)

    def set_line(self, mode = "black", index = 1):
        return module_auto.common_request("d15458545f64480795e1c8a607dce926", ( mode , index ) , 30)

    def get_vector_start_x(self, index = 1):
        return module_auto.common_request("3d29d47571cffb09289844031f2e642b", ( index ) , 30)

    def get_vector_start_y(self, index = 1):
        return module_auto.common_request("a38492c3f38fbb50d784083d7d458787", ( index ) , 30)

    def get_vector_end_x(self, index = 1):
        return module_auto.common_request("dd8485e45a1335d481309800b557b72a", ( index ) , 30)

    def get_vector_end_y(self, index = 1):
        return module_auto.common_request("184ab213b139c1f5ec4cb24f2f50e6fe", ( index ) , 30)

    def set_vector_angle(self, angle, index = 1):
        return module_auto.common_request("9876f59082b10d5cb9ff227d6580acb1", ( angle, index ) , 30)

    def get_vector_angle(self, index = 1):
        return module_auto.common_request("9235b918cc92b3ff564a0ad82119e4dc", ( index ) , 30)

    def set_kp(self, kp, index = 1):
        return module_auto.common_request("bb3e59b6b7d7bb21a09a58d958289748", ( kp, index ) , 30)

    def get_sign_diff_speed(self, sign, axis, axis_val, index = 1):
        return module_auto.common_request("82db41994c40f625b08ea18f395178a9", ( sign, axis, axis_val, index ) , 30)

    def get_label_diff_speed(self, label, axis, axis_val, index = 1):
        return module_auto.common_request("c528dcf5d85889c6bb49508114f81d70", ( label, axis, axis_val, index ) , 30)

    def get_follow_vector_diff_speed(self, index = 1):
        return module_auto.common_request("84ace6214b0b14c20a9acc1431947308", ( index ) , 30)

    def is_lock_sign(self, sign, axis, axis_val, index = 1):
        return module_auto.common_request("1ec6126d268ed8fb8fe734a93dd7ef58", ( sign, axis, axis_val, index ) , 30)

    def is_lock_label(self, sign, axis, axis_val, index = 1):
        return module_auto.common_request("36baca791b38b9f586e224227e314a9f", ( sign, axis, axis_val, index ) , 30)


I am honestly not sure if this would work, as I haven’t done anything like this before with my cyberPi. I don’t think that there are any libraries for these two specific microcontrollers to communicate with each other. You could write a library for them or something, but that would be complicated (at least for me). So in theory, it would be possible, but I wouldn’t take the risk of buying the openMV for this project (But I would still recommend buying the OpenMV if you are using it for a robot that doesn’t require any other microcontrollers or something similar).

Not sure if this is relevant, but the openMV cam would connect to the mbot2 shield… this also has a microprocessor.
The shield already has some basic scratch blocks to read and write pins (digital read/write pin or analog write pin S1 / S2)
Here are also the schematics of the cyberpi.
Here’s the docs on makeblock micropython UART and SPI - this leads me to believe it should be possible, no?