Problem with Int32MultiArray publisher/subscriber

asked 2016-07-18 06:36:27 -0500

Oper gravatar image

I have a problem with a Int32Multiarray message.

My publisher is like that:

std_msgs::Int32MultiArray msg;

and my subscriber uses rosserial, so it is like that:

void motorCmdVelSub(const std_msgs::Int32MultiArray& msg)
char temp_msg[100];
long int sx;
long int dx;[0];[1];
sprintf(temp_msg,"left %ld , right %ld", sx, dx);

when i execute:

'rostopic echo motor'

it prints:

dim: []
data_offset: 0
data: [255, 255]

and this are the right values, but at the same time my subscriber via function call to nh.loginfo prints out to me the wrong values.

sx 128 dx 255

Can you help me? thank u!

edit retag flag offensive close merge delete