Skip to content

subframes tutorial#326

Closed
rhaschke wants to merge 6 commits intomoveit:masterfrom
rhaschke:add-named-frames
Closed

subframes tutorial#326
rhaschke wants to merge 6 commits intomoveit:masterfrom
rhaschke:add-named-frames

Conversation

@rhaschke
Copy link
Copy Markdown
Contributor

I cleaned @felixvd's initial tutorial for the new subframes feature a little bit to prepare it for inclusion into the main repo. Felix, please have a look.
This belongs to moveit/moveit#1439.

@rhaschke
Copy link
Copy Markdown
Contributor Author

Ping @felixvd, can you handle the remaining Travis issues and finalizes this?

Copy link
Copy Markdown
Contributor

@felixvd felixvd left a comment

Choose a reason for hiding this comment

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

I forgot to submit this comment when I took a look a few weeks ago apparently.

planning_scene_interface.applyAttachedCollisionObject(att_coll_object);

// Wait a bit for ROS things to initialize
ros::WallDuration(1.0).sleep();
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.

Sure this is unnecessary? I took it from another tutorial.

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.

Yes, it was probably needed before when addAttachedCollisionObject was used.
This is probably a leftover from before the apply* functions existed.

@felixvd
Copy link
Copy Markdown
Contributor

felixvd commented Jun 20, 2019

Sorry for the long wait. I couldn't focus on this because I have a deadline for a few papers to meet at the end of the month, but I was planning on making this a proper tutorial instead of a stub before merging. First half of July I hope!

return false;
}

void addCollisionObjects(moveit::planning_interface::PlanningSceneInterface& planning_scene_interface)
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.

Could you maybe rename this function to setupCollisionObjects or prepareCollisionObjects instead to avoid name collision with the PSI functions?

Personally I would prefer setting up a vector of collision objects here instead of passing the PSI, but that's personal preference.

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.

I renamed it but kept the PSI as an argument, because the point is to keep the collision object definition inside the function.

planning_scene_interface.applyCollisionObject(co);
co = cylinder;
co.operation = moveit_msgs::CollisionObject::ADD;
planning_scene_interface.applyCollisionObject(co);
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.

Please use applyCollisionObjects here to perform the updates in one ROS service call.

/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, who?
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.

Add your name

* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage nor the names of its
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.

Add your name

ROS_INFO_STREAM("Attaching cylinder to robot.");
planning_scene_interface.applyAttachedCollisionObject(att_coll_object);

//---
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.

Especially since this is a tutorial, please add a lot more inline documentation

planning_scene_interface.applyAttachedCollisionObject(att_coll_object);

//---
int c;
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.

please use full-word variable names

//---
int c;
tf2::Quaternion orientation, orientation2, orientation3;
geometry_msgs::PoseStamped ps, ps_0;
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.

better variable names

"\n11 to move to a certain point in space with end effector (for visualizing the subframe pose)"
"\n12 to move to a certain point in space with cylinder/tip ");
std::cin >> c;
if (c == 0)
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.

not a big deal, but a switch statement would be best, right?

Subframes Tutorial
============================

This is just to test the subframes in a easy to run format.
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.

I'd be fine merging this tutorial as-is now (after addressing feedback), and improving it in the future when you have time. Please add note here that its a stub, though.

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.

Thanks for all the comments in a very rough file that wasn't meant to be in a PR yet :)
I would prefer to finish this up properly before merging it. Otherwise it won't really be displayable on the website at all. Give me a week or two until things cool down and I'll write up something proper.

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.

From many experiences, the statement "I'll get to it when things cool down" rarely happens, so even this would be better than nothing ;-)

@felixvd
Copy link
Copy Markdown
Contributor

felixvd commented Jul 11, 2019 via email

@davetcoleman
Copy link
Copy Markdown
Member

friendly ping @felixvd

@felixvd
Copy link
Copy Markdown
Contributor

felixvd commented Jul 31, 2019

I addressed all the changes except the switch statement in this branch in my fork, but I don't know how to add it here. With these changes it should be an actual tutorial. Can you cherry-pick the two commits @rhaschke ? Otherwise I can do a PR from the other branch as well.

I added a ~2 MB gif, but I can also send the video file for uploading to Youtube. You decide.

subframes_tutorial_cylinder_demo_small

@felixvd felixvd mentioned this pull request Aug 1, 2019
2 tasks
@davetcoleman
Copy link
Copy Markdown
Member

Closed by #365

@rhaschke rhaschke deleted the add-named-frames branch August 28, 2019 07:08
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