-
Notifications
You must be signed in to change notification settings - Fork 698
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
Improve perception tutorial #633
Conversation
2de10f7
to
3331dea
Compare
What happened to the launchfile? 😆 Also I still get some warnings with the obstacle avoidance launchfile:
|
I pointed out the "no collision geometry" errors to the panda team before when they changed their collision geometry and they ignored me.
This one's a bit harder to fix because the transforms world->camera and world->robot are published independently and the logic will only wait for the former one before attempting the transforms for all individual robot transforms. |
You wrote something somewhere about not being able to reference a launchfile from another and this being the reason for the removal of said launchfile? Could you elaborate a bit? |
I left this patch as-is though, because it actually makes sense to look at the full pointcloud/octomap and then start the node that recognizes and filters the cylinder. |
3331dea
to
dd8a182
Compare
I was just asked to run this blindly and it doesn't segfault for me on Ubuntu 18.04 (in the I didn't read this in detail, but my superficial impression is that the copy-pastable, executable lines should come first, and the explanation about the configuration and how to do it with a custom robot second. |
works for me on Debian unstable as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be best if more of a perception expert also reviewed this, like @JStech
roslaunch moveit_tutorials detect_and_add_cylinder_collision_object_demo.launch | ||
Keep the launch file from above running and run the code directly from moveit_tutorials: :: | ||
|
||
rosrun moveit_tutorials detect_and_add_cylinder_collision_object_demo | ||
|
||
KNOWN ISSUE - You may see the following error when running the demo :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this PR address this issue, enough to remove this disclaimer? Below the fold it says "We are working on fixing it" which is not true, no one has commented on the linked issue in 3 years
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing the errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source of the error is that the shape updater used for self-filtering has to wait for transforms from the whole robot to the planning_frame.
The waiting time can be configured by a magic ROS parameter and I increased the value to 0.5 seconds.
That works well on my intel i5 laptop and I expected it would be enough time for the robot_state_publisher
to publish the robot transforms even on a weak user machine.
@JStech Could you please try different values and see how much time is actually needed on your system to get rid of these errors?
Alternatively (or in addition) we could throttle the publish frequency of the point cloud and reduce the maximum iterations of the RANSAC runs to reduce some computational load.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was sufficient to stop the errors for me:
diff --git a/doc/perception_pipeline/src/bag_publisher_maintain_time.cpp b/doc/perception_pipeline/src/bag_publisher_maintain_time.cpp
index fa40247..1ad1b96 100644
--- a/doc/perception_pipeline/src/bag_publisher_maintain_time.cpp
+++ b/doc/perception_pipeline/src/bag_publisher_maintain_time.cpp
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
ros::Rate loop_rate(0.2);
while (ros::ok())
{
- point_cloud_ptr->header.stamp = ros::Time::now();
+ point_cloud_ptr->header.stamp = ros::Time::now() - ros::Duration(0.1);
point_cloud_publisher.publish(*point_cloud_ptr);
loop_rate.sleep();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And increasing shape_transform_cache_lookup_wait_time
to 0.6 seconds instead does not work?
I'm not happy with introducing a delay to the "camera driver".
If the driver is that perfect and can provide current data on the topic, MoveIt should be able to handle that, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that fix it reliably?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for leaving this hanging out to dry for so long, I'm overwhelmed by all the open things to do in MoveIt and my strongly constraint personal availability.
What did fix it was adding a half second sleep before the publish loop.
I'm somewhat unsure what you mean here. Do you actually mean before the loop or before the publish
call.
I just made the publisher latched (makes sense to me anyway with a 0.2s publish rate) and increased the queue size.
If you meant the first location, this should solve it as well.
I still wouldn't be happy to add a sleep to the second location because it artificially delays messages and if MoveIt can't handle perfect times we should fix that in MoveIt.
However, by now I'm more interested in finally getting this merged, so if you say the problem only disappears with a sleep before publishing, I'd add it for now with a note.
Please confirm @JStech .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @JStech
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, been busy here too. I mean before the loop:
ros::Rate loop_rate(0.2);
ros::Duration(0.5).sleep();
while (ros::ok())
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just pulled, built, and ran the latest version (cab19fd), and I still get the error. (And the delay still fixes it.)
doc/perception_pipeline/src/detect_and_add_cylinder_collision_object_demo.cpp
Outdated
Show resolved
Hide resolved
doc/perception_pipeline/src/detect_and_add_cylinder_collision_object_demo.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me--just a couple minor word choice things. I built and ran the code and it all worked.
Something that occurred to me while reading through it is it would be good to have a style guide for the tutorials, to specify how to format code and file names and package names etc.
roslaunch moveit_tutorials detect_and_add_cylinder_collision_object_demo.launch | ||
Keep the launch file from above running and run the code directly from moveit_tutorials: :: | ||
|
||
rosrun moveit_tutorials detect_and_add_cylinder_collision_object_demo | ||
|
||
KNOWN ISSUE - You may see the following error when running the demo :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing the errors.
doc/perception_pipeline/src/detect_and_add_cylinder_collision_object_demo.cpp
Outdated
Show resolved
Hide resolved
doc/perception_pipeline/src/detect_and_add_cylinder_collision_object_demo.cpp
Outdated
Show resolved
Hide resolved
👍 Please feel free to sketch out something and we can talk about it at a maintainer meeting. |
It was posted in #641, for the record. I haven't tested this but unless it introduces new errors, I would merge it anyway. It's definitely an improvement. |
c8008d6
to
cab19fd
Compare
Start filter binary independent of the launch file. That way users can actually see the full octomap before filtering. Also, the naming did not make too much sense, so I renamed the c++ binary to address this.
whitespace after headings is cleaner in my opinion.
The other way around is very unusual. The inverted transform was obtained via tf.transformations: x=euler_matrix(1.92,0.2,0.0) x[:,3]= [0.115, 0.427, 0.570, 1] y=inv(x) euler_from_matrix(y) (-1.913576516039647, 0.06802709809607763, 0.1882209039815404) y[0:2,3] array([ 5.33862101e-04, -4.00291774e-01, 6.00183481e-01, 1.00000000e+00])
Also see moveit/moveit#2627 for more details. Closes moveit#192.
WHY did this ever work when the pointer was not allocated... Also check ModelCoefficients for correct results. Lastly, run estimation *EVERY TIME*, don't stop after first detection.
It's still not good, but at least it does not look for cylinders of size 1m anymore.
According to @JStech this is required to get rid of some hard-to-trace tf extrapolation errors.
They are hopefully fixed now.
cab19fd
to
ad617bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, all good now.
I'm not a maintainer. (Just a pseudo-maintainer of MoveIt Calibration.) |
I tried to address #631
and improved various aspects of this tutorial. It's still quite ugly in general
and actually segfaults for me locally, but that's hopefully just because of an issue in my custom PCL version?
Please review @simonschmeisser
EDIT: For the sake of completeness here is my gdb backtrace: