Secondly, when I manually refresh the simulation cell, the resulting positions of the nodes are not at all what I expect, based on the forces that I think I am appplying. It may be a matter of experimenting with the strengths or other parameters of the forces, but I really need to get the simulation to trigger automatically first, so that I can see the results of the forces as I experiment with them.
But for something like a transition (or a smooth change to a force-directed graph), you need side-effects (mutation) to make the change less disruptive. Hence the side-effect cell (calling chart.update) in the sortable bar chart as a way to minimize and isolate where the mutation happens inside the chart cell.
I was trying to see if my spring would react as expected if I were to pull that other part, and I figured out that adding a force to said part was the thing to do. So I went to "dynamic simulation" but the "force" button is grayed out. Can someone help me with this ? Sorry if this is kind of a dumb question, I'm a bit new to Inventor.
I have used the Unknown force command in past, and for some reason I can get the simulation to run fine, but when I try to solve for the unknown vertical force it gives me an error of "Impossible to assemble the mechanism. Please check joints' nature and geometry."
I had to work very carefully with this model to make sure it was not over constrained, and I have created a simplified level of detail in an effort to get it running / solving, then add more complexity.
Regarding the jack force end, it seems I don't understand. For location 1 and location 2, I can only select points? I am looking for the force in the vertical bar that would pull the mechanism from closed to open. So I selected either end of the vertical bar, which gives me the two indicating arrows in line with the bar. This is not correct?
By selecting both ends of the vertical bar - you are in effect saying, "Pull the ends of the bar apart (or with equal force to keep static).) (When you run it - you will see that it is zero.) This does not make logical sense. Some static point should be selected for one end rather than two points on the same component, but I have not had time to look at it yet to decide where I would place the other end. It will be tomorrow till I have time to dig deeper.
I have a general question regarding the dynamic simulation module of Inventor. I have an assembly of Heavy-Machine Crawler Track with it's drive tumbler, there are around 55 track-plates of 550Kg each which will be driven by drive tumbler, I would like to ask, if this kind of mechanism could be studied by dynamic simulation in inventor with respective forces applicable as I have tried to run the simulation but Inventor crashes sometimes and also when joint is inserted as 3-d contact between drive cams and crawler links, then it's also not detecting the contact points effeciently.
I am trying to understand stopping d3.force simulations. According to documentation, I should be able to do simulation.stop() and then either restart or tick through it. However the code below simply stops working if I uncomment the simulation.stop() line. It seems that the simulation.tick() lines are ignored altogether. What am I doing wrong?
Maybe this isn't the best way to do this, but now that I've gone down the rabbit hole, I want to know how it works. I'm trying to use d3 to create a tree where the nodes will settle downwards, much like there is gravity. I'm hoping that this, along with the charge that each node has and the tension in the rope will make it so that it will end up looking as I imagine, with it balancing itself out. I'm trying to simulate this constant downward acceleration in d3, but I'm a beginner at d3, and don't know exactly how. I'm also running into the problem that the simulation stops running, and d3.timer(force.resume) doesn't help.
So essentially, I want to have a root node fixed at a certain position like a pivot, with child nodes coming off of it and gravity, charges, and tension being present so that the children settle automatically and balance themselves into a tree structure.
Force directed simulations are a great way to layout a tree, a diagram, or a graph. This method is used in many open source and commercial libraries and applications, so D3 is just one of many. Also, this topic constantly attracts attention of applied mathematicians.
I just want to tell you this is a huge topic. If one limits oneself just to D3, there are still a number of ways to do what you described in your question. Since this answer has to have a reasonable length, I'll try to show only some highlights to you, by walking you through 3 D3 examples. I'll start with a simple example of force directed tree layout (that is not really what you want, bit it is simple), and each example will build on previous, and will be closer to what you want to achieve.
Let me know if you have additional question related to this example. I know the code looks a little weird for people without D3 experience - but, in reality, its very simple, and easy to understand, once you get D3 force layout to know. You can play with different D3 gravity and D3 charge, to understand better why specific values 0.2 and -200 are chosen.
However, you can notice somwhat unnatural arangements of certain nodes in the diagram - generally, they don't look like precisely as if they are "hanging" off of parent. Next example will be an attempt to fix that.
New in this example is just one more custom force: one that "centers" all parents to the middle of horizontal positions of their children. You can easily find the code responsible for that in the "ontick()" function.
This looks much closer to what what you want. I am not claiming this is an ideal layout for your needs. However, it can serve you as a good starting point. Once you understand all these examples, you will be able to modify them, and, if you want, to create different simulations, based on different custom forces.
So, the last example is not simulation based on physical gravity, but it has effects similar to physical gravity. If you want to simulate physical gravity, this will require a little bit more of code - but do you really need it, if the effect is almost the same?
The easiest way to do this would be to simply tweak the "size" if the layout so that the center for the existing "gravity" force is at the bottom of the display, while the root node is fixed at the top of the display. However, you will probably have to do a lot of tweaking of parameters to get things looking nicely.
Another option would be to add a "custom force", similar to what is used in the Multi-foci force layout example. The specifics of the calculation used in that demo aren't relevant, but the idea is simply that, at the beginning of each tick() function, every data point is adjusted slightly in a certain direction. If that direction throws off any of the other constraints, it will be counter-acted in the next tick by the internal calculations of the layout.
Getting the gravity function optimized for a nice layout will be the tricky part. Based on my experiments, you will probably want to keep track of the depth of each node in the tree, and have either the gravity function or the link strength correlate with depth, so that you don't end up stretching out the "trunk" of your tree too much.
You are totally right! We mostly deal with rigid body engines for physics simulations. Ammo does have soft-body support, but this is not exactly what you are looking for. I believe @Cedric will be able to provide a better answer about soft bodies though.
But if you want to use Babylon as a rendering engine only (the easier and quicker solution) you will need to run the simulation on your own using d3 code, get the information on each frame, and update the babylon scene accordingly. You can add that to a scene observable (pre-render) or simply run it prior to calling scene.render() when running the render loop.
Thanks for the detailed response @RaananW and others, this is super helpful.
It sounds like the right thing for me to do is first validate that d3 will give me what I need in terms of performance (ie. use it off the shelf, with Three integration for now) and then if that works I can come back to Babylon and explore one of the two integration options you suggested.
Really appreciate you all taking the time to help!
I'm trying to simulate a force sensor located at the tip of my robot. I'm using ros indigo with gazebo 2.2.I went through this and this tutorials and I was able to publish the contact state of a box model using libgazebo_ros_bumper.so.
What I'm interested in is to use a proper force sensor with the associated force controller. I didn't found any documentation about that in Gazebo Tutorials website and I'm asking in the case someone has had the some issue.
I always get an error that the joint I want to cope with does not exist. Did you have the same problem before? And can you tell me how you define the inertial parameters to get a right measurement? Thanks a lot!
Sounds like probably you misspelled the joint name in the URDF. Consider that in my example code the parameter name contains the string schunk_wsg50. To be sure, fill both gazebo reference, and jointName tags with the correct joint name. All the inertial parameters of my robot remained untouched.
Sometimes I get the jointName: joint does not exist error too. It's certainly not a typo and I find that it depends on which specific joint on choose for a robot arm model with a mobile base.A potential solution:
I am trying to get a waving effect for a flag in my animation I am working on. However when I click alt a the cloth fabric just hangs there not being affected at all by the wind. I have wind power at 163 and it is aimed right at the flag yet it still does not work. is the link to the file.
I've found that the cloth seems to need to "drop" completely before it will be affected by the wind. I tried a plane hanging from the top edge and because it was already in the "dropped" position it animated straight away with a wind force of 2000 to 9000 it flapped nicely, 10000 made it go nuts. I tried with a cloak next, much more complex, and after pinning it, it took 100 frames before I got some ripples with a wind force of 9000
c80f0f1006