Page 1 of 1

simxPackFloats in ROS

Posted: 15 Jan 2018, 21:39
by mamagosia
Hello,

I found function simxPackFloats in Remote API. I want to send data from Python script to V-REP via ROS in similar way, like it happens in Remote API, without Remote API. How are those data packed?
E.g. I have got:

Code: Select all

tab = [1.222, 2, 3.55555555, 0, 0, 4]
and after simxPackFloats it will be:

Code: Select all

     1.222     2.000     3.556     0.000     0.000     4.000
or something like that:

Code: Select all

['1.22', '2.00', '3.56', '0.00', '0.00', '4.00']

Re: simxPackFloats in ROS

Posted: 17 Jan 2018, 10:23
by coppelia
Hello,

have a look at the simxPackFloats function in the python remote API. But basically, in plain C we would have:

Code: Select all

float myFloats[]={1.222f, 2.0f, 3.55555555f, 0.0f, 0.0f, 4.0f};
char* packedFloats=(char*)myFloats;
Cheers