RobotMesh with other Python libraries?

I am looking at using RobotMesh Python for a course I’m teaching this summer. We also do a unit on computer vision, and it’s important that I can install other Python libraries. I want to be able to do things like:

if fancyPythonLib.faceIsVisible:
motor.move_forward.

Is it possible to install other Python libraries in a RobotMesh environment?

Follow-up question: if we used RobotC instead, could we install other C libraries?

How would you be expecting to use the vision library? You wouldnt have a camera. Also a cortex is really weak for something like this.

I will explain how I would do something like this.

Laptop running python program doing any vision you want running from webcam.
Cortex with Bluetooth HC-05 plugged into UART port and using Robot Mesh python.

Then both sides can communicate simply. Python on your laptop has libraries for using the com port connected to bluetooth and reading/writing from UART is easy on cortex.

HC-05 bluetooth chips are 2$ each here
https://www.aliexpress.com/item/Wireless-Serial-6-Pin-Bluetooth-RF-Transceiver-Module-HC-05-RS232-Master-Slave/32638229616.html?

In answer to the actual original questions.

A python library that is written in pure python and you have the source code should just work for free. Any other library (especially anything processing heavy) I would expect not to work. @RobotMesh might disagree with me. (I say processing heavy libraries won’t work because they will all rely on compiled c code)

This one is a little more tricky. ROBOTC isn’t “true” C so anything more than the most basic C program will need some effort to port source code. I would expect most libraries to not even be impossible to port properly because ROBOTC doesn’t support dynamic memory allocation.

If your goal was to use C libraries you would have a lot better time using PROS.
https://pros.cs.purdue.edu/
It is real C so any c code/libraries(from source) should just work for free. However the size of the flash on the cortex will make large libraries impossible. RAM and CPU will make large amounts of processing impossible as well.

Thanks, @tabor473 . I am interested in this bluetooth solution you’ve proposed. Can you provide a few more details?

The HC-05 chip you linked would plug into the cortex - would we need any add-on for the laptop? Does the laptop just output a standard bluetooth signal? How do you pair the laptop and the HC-05?

Additional thoughts:

Quick note - none of this is being used in competition.

Previously I’ve accomplished this using a MindSensors PiStorms interface and I’ve run the vision code using a Raspberry Pi. I’m looking to transition to VEX this year instead of LEGO MindStorms but I need to figure out if I can do the computer vision work.

I’m also wondering whether it would make sense to strap a Raspberry Pi to the Cortex and do some of the processing there. It’s not clear to me whether that provides any benefit over using the laptop over bluetooth.

Thanks for helping me think through this!

So it has been discussed here
https://vexforum.com/t/bnsbluetooth-robotc-library-for-the-hc-05/29982/1
https://vexforum.com/t/hc-05/34865/1

It is really quite simple to use. Your laptop just needs to have built in bluetooth functionality. I just assume all of them do. A raspi would also work, communication between pi and cortex would have to be over UART anyway so the code would be identical on both ends. (Bluetooth, UART, USB are all categorized as just different com devices)

If you want the computer on board the pi would be better but I assume you already have a laptop.

I am one of the guys around the forum who works a lot with coprocessors and communication to laptops. Ran both of these projects.
https://vexforum.com/t/wpi-lidar-explanation/35017/1
https://vexforum.com/t/wpi1-reveal/41037/1

No, Robot Mesh Studio currently doesn’t allow you to import additional modules beyond those we support (basically sys, math, vex and the builtins for list, tuples etc.)

As tabor573 mentions, the processing power and the available memory/flash on the VEX Cortex don’t make it feasible to do computer vision directly on the cortex. So using a data connection to a separate computer would be a way forward. The program running on the VEX Cortex could handle such a serial connection if it was written in Robot Mesh Python or in Robot C, or PROS.