TranslationEngine + RotationEngine

Asked by Daniela

I tried to use

O.engines=[
...
TranslationEngine (..., label='t') + RotationEngine(...,label='r'),
...]

but if I want to change some parameter (for example, t.velocity or r.angularVelocity), then it does not recognize t or r.
How should I use this combination of engines?

Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Daniela
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Maybe "+" works for some reasons, but the elements of a list are usually
separated by commas. Did you try without the "+"?

Revision history for this message
Daniela (dmaionchi) said :
#2

Hi,

I also tried without +, instead of that I used comma comma between the engines, and it seems that the second one overwrites the first one, as they are acting on the same body.

O.engines=[
...
TranslationEngine (..., label='t'), RotationEngine(...,label='r'),
...
]

If I use the +, then I see that both Engines work, but I don't have access to the parameters.

Is it maybe some problem in the implementation of the CombinedKinematicEngine, that doesn't take account of the labels?

Thansk again for the help.

Revision history for this message
Daniela (dmaionchi) said :
#3

After many tries, I got to solve the problem using this:

CombinedKinematicEngine(ids=body1,comb=[TranslationEngine(translationAxis=[1,0,0],velocity=10),RotationEngine(angularVelocity=10,rotationAxis=[0,1,0],rotateAroundZero=1,zeroPoint=(0,0,0))],label='Eng')

I can access all parameters inside the engine writing for example Eng.com[0].velocity=20.

Thansk again for all suggestions.

Revision history for this message
Anton Gladky (gladky-anton) said :
#4

Glad, that you have solved that.
By the way, it would be good to have it somewhere in docs or in examples.

Anton

On Tue, Jul 12, 2011 at 6:01 PM, Daniela
<email address hidden> wrote:
> Question #164510 on Yade changed:
> https://answers.launchpad.net/yade/+question/164510
>
> Daniela posted a new comment:
> After many tries, I got to solve the problem using this:
>
> CombinedKinematicEngine(ids=body1,comb=[TranslationEngine(translationAxis=[1,0,0],velocity=10),RotationEngine(angularVelocity=10,rotationAxis=[0,1,0],rotateAroundZero=1,zeroPoint=(0,0,0))],label='Eng')
>
> I can access all parameters inside the engine writing for example
> Eng.com[0].velocity=20.
>
> Thansk again for all suggestions.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Daniela (dmaionchi) said :
#5

I will try to organize it in an example and send to you.

Revision history for this message
Yade Guide (yade-guide) said :
#6

Hey there! As an automated bot, I've gone ahead and found relevant threads that might interest you. Feel free to explore further by clicking on the links provided.

Title: "setting initial velocity"
Bruno suggests starting with impacting a single facet on a single sphere, Jim faced an error during clumping due to needing to set mass and inertia of facets before clumping them. Jan provided guidance on how to properly append the clumped facets to the bodies list.
https://answers.launchpad.net/yade/+question/673023

Title: "Simulation blocked after O.run in a conditional translation motion"
User encountered issues with their Python simulation involving TranslationEngine. They sought help for a motion translation problem caused by a frozen boundary at the O.run(1,True) statement. The user tried using O.wait() without success and found it strange that O.run();O.wait() didn't execute O.run(1,True). Jan Stránský suggested removing PyRunner(command='kinematics_WS()',...) from O.engines and calling kinematics_WS() at the end of the script, which solved the problem.
https://answers.launchpad.net/yade/+question/688203