Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use action communication mechanism in this plugin #411

Open
54onePiece opened this issue Oct 15, 2020 · 9 comments
Open

Use action communication mechanism in this plugin #411

54onePiece opened this issue Oct 15, 2020 · 9 comments

Comments

@54onePiece
Copy link

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?

@Levi-Armstrong
Copy link
Member

Sorry, I am not understanding the question. Could you provide more information?

@54onePiece
Copy link
Author

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

@Levi-Armstrong
Copy link
Member

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

@54onePiece
Copy link
Author

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.

@Levi-Armstrong
Copy link
Member

Is this in the main GUI thread?

@Levi-Armstrong
Copy link
Member

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.

@54onePiece
Copy link
Author

OK,I will try it. Thank you so much!

@54onePiece
Copy link
Author

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.

@54onePiece
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants