Skip to content

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