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

Software Challenge Urban Pistek #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

UrbanPistek
Copy link

Hello here is my code for the software challenge, let me know what you think, thanks!

} else {
ROS_INFO("Action Failed");
//Infinite loop to run
while(true){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you look at the tutorials we want all loops to kill if the ros master is killed so we usually use while (ros::ok())

ROS_INFO("Action Finished");
} else {
ROS_INFO("Action Failed");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're missing the ros::spinOnce function, this is the function that checks for new msgs, service calls, actions and other. its what lets us communicate between many applications running ros

int main(int argc, char **argv) {
ros::init(argc, argv, "moveTurtle");
ros::NodeHandle nh;
MoveTurtleAction(std::string name) :
Copy link

@azumnanji azumnanji Nov 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy nodehandle to class nodehandle

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to put nodehandle in its own class?
Currently nodehandle is in the MoveTurtleActionClass:
class MoveTurtleAction { protected: ros::NodeHandle nh;

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

Successfully merging this pull request may close these issues.

2 participants