meshcat | Remotely-controllable 3D viewer , built on top of three.js | Frontend Framework library
kandi X-RAY | meshcat Summary
kandi X-RAY | meshcat Summary
Remotely-controllable 3D viewer, built on top of three.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of meshcat
meshcat Key Features
meshcat Examples and Code Snippets
Community Discussions
Trending Discussions on meshcat
QUESTION
I came across the following error message when connecting get_reaction_forces_output_port()
to my controller.
ANSWER
Answered 2021-Apr-06 at 14:44What you have is an algebraic loop. A good place where to read about this could be here though the concept is a general idea that you could find in other references on dynamical systems (google search algebraic loop for more). Another read here. Finally, and probably first, I recommend reading the link provided by the error message itself in Drake, this one.
In Drake, having an algebraic loop usually (always?) means a bad modeling decision. It'd only mean one of two things:
- One of the systems has a feedthrough when it shouldn't. For instance, controllers usually work on state, and therefore they are not feedthrough.
- The feedthrough is unavoidable because you really mean what you wrote. What that means in Drake is that you should not have two systems, but one that incorporates the entire algebraic model.
In practice things can get tricky though. In your case, it'd seem you want to use reaction forces to take an action in your controller. Now, your plant model is discrete. Recall this means that we do not have an ODE but an algebraic equation (though complex) describing the next state given the current state. When you add feedback using an algebraic model of actuation u
as a function of reaction forces, what you did is to come up with a larger system of algebraic equations.
Now, think about your problem in a real robot. What you probably would do, is to measure reaction forces at time t1, to apply a control action at t2 != t1 (since reading from a sensor and computing your control action do take time). Therefore, there is an unavoidable lag in your control action. This could be modeled with a ZOH (zero order hold) which in Drake is systems::ZeroOrderHold
. If you place that block right before or after your controller, you'll break the feedthrough (hopefully clear why after reading the references above?).
Another "trick", though motivated from real experience, would be having a low pass filter to remove quickly changing forces. Adding a low pass filter between plant and the controller to filter the reaction forces will also break the loop. In Drake you can add one with systems::FirstOrderLowPassFilter
.
Again, these are not only tricks, but really the proper thing to do if you think about it.
Hopefully this helps.
QUESTION
After importing an urdf file and creating a MultiBodyPlant I see an extra parameter group with nans when I print the context. The full printed context can be seen here. The parameter group which I cannot explain/understand is this one:
...ANSWER
Answered 2020-Dec-01 at 23:15The NaNs that you're seeing in the parameter group correspond to the world body, and although they look suspicious I don't think they are the root of your problem. The world body doesn't have a valid set of inertial parameters (thus they're set to NaN), and is handled as a special case in the code. As it is written in the current implementation, the body parameter API is ubiquitous for every body. Each body has a set of parameters in the context, regardless of whether they are valid. This might be a point of contention for special bodies ('world'), so I've opened up an issue to discuss.
The problem you're having now is because your base_main
link (and thus your entire robot) is a free floating body. You're not allowed to have a free floating tree of zero mass links attached with a joint to another free floating tree of links with non-zero mass because any torque applied at the joint connecting them (Joint_base_yaw
in your case) would cause an infinite acceleration on the inboard bodies. To solve this:
(Option 1): Add a fixed joint between
base_main
andworld
in your URDF file.
QUESTION
I would like to record multiple meshcat visualizers with different prefix ids so I can eventually save them to an HTML file that I can interact with later. I would like the different visualizations to play on top of each other and to be able to select/unselect different visualizations.
Here is a minimal replication of the problem. I expect there to be two cartpole visualizations that are on top of each other. However, I only end up seeing one of them being recorded. The other cartpole seems stuck at the end position when I play back the recording
...ANSWER
Answered 2020-Nov-11 at 02:41Here is one solution. I don't love it, but it accomplishes the stated goal. Note the changes:
- saving and publishing only one animation
- naming the model in the
MultibodyPlant
with a distinct name for each sim - setting
delete_prefix_on_load=False
so it doesn't clear the old geometry
QUESTION
As I understand, without any application of external force (such as gravity), the center of mass of a multibody system should be constant if only internal torques (at the joints) are applied.
In PyDrake, I've set up a free-floating simulation of a box spacecraft with a 6 DoF arm attached. At the start, I set an initial velocity to the first joint using the following command:
...ANSWER
Answered 2020-Oct-24 at 16:29Here is my quick reproduction, in case it helps. I've confirmed that setting a very small target accuracy results in the same numbers, set the initial angular velocity down so it looks more reasonable, confirmed that the gravity is properly being zeroed, etc.
QUESTION
Is there a way to run multiple drake simulators at the same time and to see the separate visualizations in different windows?
I'm trying to run multiple simulations in parallel and I wanted to visually double check that everything looks correct. I believe Meshcat would allow for this because you can set different urls, but I'm not sure how to do it with Drake Visualizer
...ANSWER
Answered 2020-Aug-13 at 00:45Copying my suggestion from the issue:
If you set the LCM_DEFAULT_URL environment variable to a different value for each (visualizer process, simulator process) pair, the messages will be transmitted on different socket addresses and not interfere with each other.
(For the simulator, you can also set the URL in the DrakeLcm constructor, though the environment variable is often easiest when launching several processes.)
The default value for LCM_DEFAULT_URL is shown here:
drake/lcm/drake_lcm.cc
Line 22 in 20d799e constexpr const char* const kLcmDefaultUrl = "udpm://239.255.76.67:7667?ttl=0";
Using a different port number, for example, would provide for independent process pairs.
env LCM_DEFAULT_URL=udpm://239.255.76.67:7666?ttl=0 bazel-bin/tools/drake_visualizer &
or
export LCM_DEFAULT_URL=udpm://239.255.76.67:7666?ttl=0
bazel-bin/tools/drake_visualizer &
bazel-bin/stuff/my_simulator &
QUESTION
How do you setup MeshCat on an exposed port as an online interface to interact my drake program? Looking for a short example in pydrake. Presently attempting on Ubuntu 18.04 with pydrake.
...ANSWER
Answered 2020-May-01 at 23:24Here's a simple example:
The header of that file also has some useful instructions.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install meshcat
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page