ros_qtc_plugin
ros_qtc_plugin copied to clipboard
Use action communication mechanism in this plugin
I use the action communication mechanism. After connecting to the master node, the program runs to ".waitForServer();" and the program dies. May I ask how is this going?
Sorry, I am not understanding the question. Could you provide more information?
Sorry, I am not understanding the question. Could you provide more information?
I use ros_qtc_plugin to develop a program, and I need to use the action mechanism in ROS to communicate with another development program. When I was developing, a program "client.waitForServer();" in the client of the action communication mechanism failed to run. During my test, the program would freeze every time I reached this sentence. Do you have any suggestions? Or can you provide me with an example that can run in ros_qtc_plugin and use the action communication mechanism. Thanks a lot
Ah, so it stops there and never returns because most likely another node has not advertise the action you are waiting on. Bellow is a tutorial on setting up a simple action server and also has one for the client side.
http://wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionServer%28ExecuteCallbackMethod%29
Ah, so it stops there and never returns because most likely another node has not advertise the action you are waiting on. Bellow is a tutorial on setting up a simple action server and also has one for the client side.
http://wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionServer%28ExecuteCallbackMethod%29
I built the server and tested it, and it didn't reflect much. And this is not the problem of inability to connect, but the sentence that the program will crash after running, and any button clicked will become invalid.
Is this in the main GUI thread?
If so, that is not good because it will freeze the application. I recommend creating an event loop were inside this it checks if a connection is available but not wait. Once the connection is available then enable aspects of the GUI.
OK,I will try it. Thank you so much!
If so, that is not good because it will freeze the application. I recommend creating an event loop were inside this it checks if a connection is available but not wait. Once the connection is available then enable aspects of the GUI.
I created a new thread to make ros::spinnce run continuously, but the program still has that problem.
If so, that is not good because it will freeze the application. I recommend creating an event loop were inside this it checks if a connection is available but not wait. Once the connection is available then enable aspects of the GUI.
I will waitForServer return value output "Bool connected = cc_client.waitForServer(ros::Duration(5)); qDebug()<<"connected result: "<<connected;" The output is: connected result: false