-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
particles example doesn't visualize because it incorrectly uses AllocateContext #17649
Comments
I believe the error can be found here: If you change the call from |
Specifically, this points to a bug in |
My vote is that we simply delete the I do think we should have an example which demonstrates dynamics without using a MultibodyPlant, along with illustration geometry -- but I think both |
That's fine and good. However, I introduced an elephant into the room. The claim that So, in addition to uselessly showing a particle accelerate out of the view, its implementation is an anti-pattern. I did a quick survey to see if |
I believe the particle example itself is not the problem. It is the simplest example that builds a dynamical system with visualization from scratch. |
That's a good point. The API documentation for The purpose of "Allocate" is for advanced uses where we need to allocate storage ahead of time, for a function that needs an output-pointer to scribble into. Probably that means "(Advanced) " should precede the |
It might be worth considering renaming |
PR #17653 deleted the Drake copy of the broken demo, but not the There are actually a lot of copies:
This recently confused a user on StackOverflow. |
Ah, I was slightly confused. Only the |
RobotLocomotion/drake-external-examples#355 removes the broken example, and #22479 clarifies the docs. |
What happened?
As I have raised in RobotLocomotion/drake-external-examples#233, I found that the particle example did not draw in the visualizer. The example in the drake-external-examples repo is the same as that in the drake repo: https://github.com/RobotLocomotion/drake/tree/master/examples/particles.
I was noticing that neither the OutputPose callback of the geometry nor the OutputState callback of the particle system (connected to geometry) was being called during the simulation.
Besides, a simple anchored geometry registered to the scene_graph is also not showing.
However, the state of the particle and the calculating of the time derivative is working properly.
After some diggings and comparison with the scene_graph examples, I finally managed to have the particle moved and shown correctly by replacing
builder.BuildInto(this);
in the constructor of UniformlyAcceleratedParticle withbuilder.Build();
(and having the simulation inside the constructor).It seems that the BuildInto method might have some problems in handling stuff with scene_graph.
Version
No response
What operating system are you using?
Ubuntu 20.04
What installation option are you using?
apt install drake
Relevant log output
No response
The text was updated successfully, but these errors were encountered: