Packing Matrices from Python

Typically: "How do I... ", "How can I... " questions
Post Reply
adrialopezbou
Posts: 7
Joined: 17 Nov 2020, 10:37

Packing Matrices from Python

Post by adrialopezbou »

Hello,

It is possible to pack matrices in Python and send them to Coppelia? I've only seen arrays being packed. If possible, could someone give me an example of how to do it? Thanks!

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Packing Matrices from Python

Post by coppelia »

Hello,

as you mention it, you can pack arrays with the legacy remote API, e.g. with simxPackFloats. So you could flatten your matrix.

But better would be to use something like messagePack to serialize/deserialize your data. Have a look at the demo scene movementViaRemoteApi.ttt and its counterpart programming/remoteApiBindings/python/python/sendMovementSequence*.py or programming/b0RemoteApiBindings/python/sendMovementSequence*.py

Cheers

Post Reply