Skip to content

Add capability of execute known trajectory with a ROS action#60

Merged
rhaschke merged 10 commits intomoveit:indigo-develfrom
wkentaro:execute-path-action
Aug 19, 2016
Merged

Add capability of execute known trajectory with a ROS action#60
rhaschke merged 10 commits intomoveit:indigo-develfrom
wkentaro:execute-path-action

Conversation

@wkentaro
Copy link
Copy Markdown
Contributor

@wkentaro wkentaro commented Aug 17, 2016

@wkentaro wkentaro force-pushed the execute-path-action branch from 5c4fca4 to 26c5d0d Compare August 17, 2016 04:11
{
std::string response = "Cannot execute trajectory since ~allow_trajectory_execution was set to false";
action_res.error_code.val = moveit_msgs::MoveItErrorCodes::CONTROL_FAILED;
execute_action_server_->setAborted(action_res, response);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the lack of a return here on purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I fixed it.

setExecutePathState(IDLE);
}

void MoveGroupExecutePathAction::executePathCallback_Execute(const moveit_msgs::ExecutePathGoalConstPtr& goal, moveit_msgs::ExecutePathResult &action_res)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

120 char line limit

@davetcoleman
Copy link
Copy Markdown
Member

Thanks for porting this to the new repo, I'm excited about this new feature

@wkentaro
Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. I fixed them.

void MoveGroupExecutePathAction::executePathCallback_Execute(const moveit_msgs::ExecutePathGoalConstPtr& goal,
moveit_msgs::ExecutePathResult &action_res)
{
ROS_INFO("Execution request received for ExecutePath action.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missed this earlier: needs _NAMED("move_group"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops. Fixed.

moveit_msgs::ExecuteKnownTrajectory::Response res;
req.trajectory = plan.trajectory_;
req.wait_for_execution = wait;
if (execute_service_.call(req, res))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we are no longer using execute_service_ within move_group, I think we can remove it from this class (but keep the capability in general for backwards compatibility)

e.g. we don't need execute_service_ as a MoveGroup member variable and we don't need to initialize it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

-1
See main comment.

@davetcoleman
Copy link
Copy Markdown
Member

When we merge this, is it ok if we squash-merge to cleanup the multiple commits?

@wkentaro
Copy link
Copy Markdown
Contributor Author

When we merge this, is it ok if we squash-merge to cleanup the multiple commits?

Yeah, no problem.

@davetcoleman
Copy link
Copy Markdown
Member

just merged the moveit_msgs change and retriggered this travis build

(node_handle_, move_group::PLACE_ACTION, false));
waitForAction(place_action_client_, wait_for_server, move_group::PLACE_ACTION);

execute_service_ = node_handle_.serviceClient<moveit_msgs::ExecuteKnownTrajectory>(move_group::EXECUTE_SERVICE_NAME);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can also remove #include <moveit_msgs/ExecuteKnownTrajectory.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Fixed.

@rhaschke rhaschke self-assigned this Aug 18, 2016
@rhaschke
Copy link
Copy Markdown
Contributor

@davetcoleman Please wait before merging. I want to have a look too.
We definitely need a transition process, deprecating the old execute_service as mentioned before (moveit/moveit_ros#719 (comment)).

@davetcoleman
Copy link
Copy Markdown
Member

@rhaschke sounds great. this current PR doesn't break any old functionality AFAIK, but I think you're saying that what is missing is a warning message and inline comments telling users not to use the old excute_service. Then we can remove it completely in ROS-L

@rhaschke rhaschke merged commit faaf0fc into moveit:indigo-devel Aug 19, 2016
@wkentaro wkentaro deleted the execute-path-action branch August 19, 2016 19:00
@rhaschke
Copy link
Copy Markdown
Contributor

@wkentaro @davetcoleman: Sorry, I accidentally pressed merged, while I was looking for the commandline instructions. I reverted for now, because I have some more comments.

This current PR doesn't break any old functionality AFAIK

NO! There are lots of moveit_config packages out there, which do not yet configure the new capability.
Hence, they will not be able to execute trajectories anymore.

The MoveGroupInterface should try to connect to the ExecuteAction first, and if that fails, resort to the ExecuteService (printing a deprecation warning).

Furthermore, you should adapt the template of moveit_setup_assistant.

@wkentaro I'm afraid that you need to reopen as new PR. I apologize.

@wkentaro wkentaro restored the execute-path-action branch August 19, 2016 19:16
@wkentaro
Copy link
Copy Markdown
Contributor Author

Reopened here #85

@davetcoleman
Copy link
Copy Markdown
Member

@rhaschke good points

@wkentaro
Copy link
Copy Markdown
Contributor Author

Fixed in #85

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.

4 participants