TypeError: 'Publisher' object is not callable
Hello all.
I am trying to publish to a topic, using python with a custom message file.
My message file name is "joints.msg" and is:
float32 q1
float32 q2
float32 q3
In my python code I have the following (as far a the publisher is concerned):
#!/usr/bin/env python
import rospy
from input_suport import *
from archoff.msg import joints
.
.
.
pub_torques = rospy.Publisher('torque_topic', joints, queue_size=10)
#sub_angles = rospy.Subscriber("angles_topic", joints, get_angles)
rospy.init_node('humerus_m', anonymous=True)
rospy.sleep(1.)
.
.
.
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
.
.
.
j_speed = joints(dq[0][0], dq[1][0], dq[2][0])
pub_torques(j_speed) # first attempt
#pub_torques(1.0, 4.2, 3.2) # second attempt
rate.sleep()
As you can see above, I tried with two different ways but nothing works. I always get the message:
TypeError: 'Publisher' object is not callable
Any idea what I am doing wrong?