hi there, i want to do spiral trajectory using a PID controller, for that i used a for loop so that at each iteration it gives a new target. I used this code for the PID controller. Inside the for loop in my main code a callback function which is a methode in a class called when subscribing, the problem is that the code manages just the first iteration once the callback function is running it never stops. please any idea how to loop throw all the values Here you can find my code.
Originally posted by rayane on ROS Answers with karma: 27 on 2017-04-26
Post score: 0
Original comments
Comment by billy on 2017-04-26:
I'm not 100% sure I understand your question. But when you says the callback never stops, do you mean it never comes back to the 'main'? If that is your concern, remember that spin() never returns, spinonce() will return.
Comment by Geoff on 2017-04-26:
Please post your complete code when asking a question. If there is a lot of code, then putting it on Github and giving us a link to the repository, or creating a Gist (but never delete it or the question will become useless!) would be easier.
Comment by rayane on 2017-04-27:
Yeah, Actually thats what i meant it never get back to the main function and i will post the whole code
Comment by rayane on 2017-04-27:
sorry dont know how to creat a Gist but i posted all the codes i used ( two classes and the main code). And for spinOnce it didn't work, it didn't even run the callback function. please any other ideas!!
Comment by Geoff on 2017-04-27:
You haven't posted all your code. Where are the header files?
The link that I posted above explains how to create a gist.
You should try and reduce your code down a minimal program that has the same problem, fix the problem, then add features.
Comment by rayane on 2017-04-28:
@Geoff here it is the link for my code,any suggestion is appreciated