Publishing arrays unsuccessful
Hi all,
I have been following this http://answers.ros.org/question/9471/how-to-recieve-an-array-over-publisher-and-subscriber-python/ (question) very closely.
This is how mine looks like:
def talker(armj_acc) : pub10 = rospy.Publisher('/armj_acc', obs_arm_JointAccelerations) msg2send10 = obs_arm_JointAccelerations() msg2send10.header.stamp.secs = time_now msg2send10.accelerations = armj_acc pub10.publish(msg2send10)
I have my own custom message, by the name obs_arm_JointAccelerations which contains
Header header float64[] accelerations
The variable armj_acc is actually a list whose values have been successfully calculated and passed into the function, which I print them on the screen. The calculation for the armj_acc is done via subscribing velocities from the /joint_states topic, every 4 seconds ((current velocity - previous velocity) /4).
The problem is, whenever I try to echo the topic, it gives me the following error:
(1) In the terminal where the topic is being echo-ed
WARNING: no messages received and simulated time is active. Is /clock being published?
(2) In the terminal where the code is run:
[ERROR] [WallTime: 1367266510.640556] [5269.097000] bad callback: <function callback="" at="" 0x2f6e1b8>="" traceback="" (most="" recent="" call="" last):="" file="" "="" opt="" ros="" fuerte="" lib="" python2.7="" dist-packages="" rospy="" topics.py",="" line="" 678,="" in="" _invoke_callback="" cb(msg)="" file="" "="" home="" path="" to="" my="" package="" script="" obs_armj_all.py",="" line="" 47,="" in="" callback="" talker(armj_names,="" armj_act_positions,="" armj_act_velocities,="" armj_effort_act,="" armj_effort_diff,="" armj_pos_rel_diff)#,="" armj_acc)#,="" armj_jerk)="" file="" "="" home="" path="" to="" my="" package="" script="" obs_armj_all.py",="" line="" 185,="" in="" talker="" pub10.publish(msg2send10)="" file="" "="" opt="" ros="" fuerte="" lib="" python2.7="" dist-packages="" rospy="" topics.py",="" line="" 796,="" in="" publish="" raise="" rosserializationexception(str(e))="" rosserializationexception:="" cannot="" convert="" argument="" to="" integer<="" p="">
Any ideas?
Thanks.