Hello every one!
I have made an interface for one robot we are doing in our Secondary School. We have made it with PyQt5. The interface works fine and now we want to use it with other Python file, go_to_specific_point_on_map.py which works fine without the interface.
When I try to put all together, I get some errors that I don’t know how to solve because I don’t know a lot about Python.
I have made several tries but I think my best one are:
ejecutaprueba4.py and ejecutaprueba5.py
With the first one I get the next error:
$ python ejecutaprueba4.py
[INFO] [1572298461.772443]: Go to (1.22, 2.56) pose
Traceback (most recent call last):
File “ejecutaprueba4.py”, line 94, in
window = Ui()
File “ejecutaprueba4.py”, line 16, in init
self.button.clicked.connect(self.ir(1))
File “ejecutaprueba4.py”, line 80, in ir
success = self.goto(position, quaternion)
File “ejecutaprueba4.py”, line 43, in goto
self.move_base.send_goal(goal)
AttributeError: ‘Ui’ object has no attribute ‘move_base’
And with the second one I get:
$ python ejecutaprueba5.py
Traceback (most recent call last):
File “ejecutaprueba5.py”, line 23, in
window = Ui()
File “ejecutaprueba5.py”, line 17, in init
irPuntoMapa = GoToPose()
File “/home/mubita/go_to_specific_point_on_map.py”, line 41, in init
self.move_base.wait_for_server(rospy.Duration(5))
File “/opt/ros/kinetic/lib/python2.7/dist-packages/actionlib/simple_action_client.py”, line 67, in wait_for_server
return self.action_client.wait_for_server(timeout)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/actionlib/action_client.py”, line 584, in wait_for_server
timeout_time = rospy.get_rostime() + timeout
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/rostime.py”, line 190, in get_rostime
raise rospy.exceptions.ROSInitException(“time is not initialized. Have you called init_node()?”)
rospy.exceptions.ROSInitException: time is not initialized. Have you called init_node()?
I think that the second one is programmed better but the first one run more time that the second. We have tried to program in different ways and try to find the error but I’m not able.
Thank you very much for your help.
Best regards
prueba.zip (4.6 KB)