'hector_quadrotor' 'TypeError: 'instancemethod' object has no attribute '__geitem__''
Hi
I was running "hector_quadrotor_demo outdoor_flight_gazebo.launch". And I build a publisher "auto_fly", to publish message to control the quadrotor. The code is showed below:
#!/usr/bin/env python
import rospy from geometry_msgs.msg import Twist
def auto_fly(): pub= rospy.Publisher('/uav/uav2/cmd_vel',Twist,queue_size=10) rospy.init_node('auto_fly',anonymous=True) r=rospy.Rate(10) # 10Hz
while not rospy.is_shutdown(): pub.publish['x=0,y=1,z=0.2' 'x=0,y=0,z=0'] r.sleep(1.0)
if __name__== '__main__': try: auto_fly() except rospy.ROSInterruptException: pass
When I run it, it shows,
TypeError: 'instancemethod' object has no attribute '__getitem__'
What does this error mean and how to fix it?
Thanks a lot Glen