Communicating Python <-> Arduino and storing dynamic values on Arduino side.

So, first of all, let me try to explain what I have and what I am trying to achieve:

I have some processing on the computer in Python, and this processing gives a set of array-like (python lists) which contains some x-y coordinates. Something like this:

[[[438, 358], [438, 357], ... , [448, 301]], [[92, 174], [91, 175], ... , [69, 206]], ... ]]]

(The explanation for this is that I have a set of segments (paths), and each segments is composed by a set of points (inner-most lists), wrapped in segments (middle lists), all wrapped in a single list (outter-most list).

These set of points are some paths that a robot must follow, so I need to send it to the Arduino to make some motor control.

I have done in the past some Python-Arduino serial communication, and the easiest way I found was to transform the numbers into strings, send, then transform back to ints on the Arduino. Ok, it does work for sending these numbers, but my problem is how to store and manipulate them on Arduino's memory, since these lists can varie on size depending on the processing made in Python.

My goal is to tranfer the whole list all at once, and after that, the robot would know where to go, without having to maintain a communication with the PC.

I have read some stuff about dynamically resizing arrays on arduino, but seems a bit complicated and blurry somehow, often unadvised. I am not really sure if messing with that would be the best solution for such a "simple" problem, but if it's the only way, I would appreciate if you could give some guidance on that.

I must state that everything here is open to some advice (lists style, serial comm, project concept, etc.). All I really need is to make the robot reach those points.

Thanks already.

pauloemp:
My goal is to tranfer the whole list all at once, and after that, the robot would know where to go, without having to maintain a communication with the PC.

What is the maximum amount of data in the longest “whole list” that you want to send?

What Arduino board are you using?

These links may help
Simple Python - Arduino demo

Serial Input Basics - simple reliable ways to receive data.
It includes a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)

Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker

…R