I am using the orocos BufferPort class to do some sequential calculations for
Basically, I have three components:
- a path generator.
- a component which does some inverse kinematics and calculates a bunch of
- a component which calculates a time-optimal trajectory along the path.
Each of these components uses information from the component one level up
and they pass data using bufferports. The reason for this is to allow a sort
of recursive approach is to do on-line trajectory generation with as little
delay as possible (I don't want to wait until the path is completely
generated, but start optimizing the trajectory based on the available data).
Now, I am using buffers which block on reading (if no data available there is
nothing meaningful the components can do anyway), but which do not block on
As a result, it seems I have to make the size of the buffers as large as the
maximum amount of data I plan to send through the buffers (usually about 2000
18-dimensional vectors of doubles).
However, in practice, "probably" the buffers will never be completely filled,
since the components add and remove the data
at a more or less similar speed.
Does anyone know how this is actually implemented in Orocos? How many
(internal) copies of the buffers does Orocos use? Does it copy the entire
buffer (even if not full) multiple times or only the filled part?
Is size an issue here (I am talking about about approximately 3 buffers with
2000 18-dimensional vectors of doubles)
Are there better ways to do this?
I have considered using buffers of size 1 and have them block on reading and
writing. However, this seems less efficient (e.g. if the inverse kinematics
takes a lot of time, there is no point in waiting with these calculations,
until the trajectory optimization starts processing).