You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(13) |
Apr
|
May
(1) |
Jun
(34) |
Jul
(23) |
Aug
(16) |
Sep
|
Oct
(11) |
Nov
(13) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
(3) |
Mar
(13) |
Apr
(1) |
May
(5) |
Jun
(11) |
Jul
(5) |
Aug
(10) |
Sep
(16) |
Oct
(8) |
Nov
(4) |
Dec
(5) |
2006 |
Jan
(18) |
Feb
(5) |
Mar
(6) |
Apr
(12) |
May
(3) |
Jun
(1) |
Jul
(4) |
Aug
(16) |
Sep
(1) |
Oct
(5) |
Nov
(35) |
Dec
(7) |
2007 |
Jan
(17) |
Feb
(14) |
Mar
(7) |
Apr
(9) |
May
(16) |
Jun
(31) |
Jul
(13) |
Aug
(23) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(1) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(3) |
Apr
(2) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
(5) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
|
2010 |
Jan
(6) |
Feb
(6) |
Mar
(10) |
Apr
(5) |
May
(11) |
Jun
|
Jul
|
Aug
(2) |
Sep
(8) |
Oct
(2) |
Nov
(3) |
Dec
(5) |
2011 |
Jan
(7) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(10) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Matthias T. <Sta...@gm...> - 2005-11-20 13:14:27
|
Hi! I am very sorry that i am posting again my test program, but i have a little problem which i am dialing with the whole day! I was inspired from tutorial2 and tutorial3 and i added in tutorial2 a block which should be connected to the ode.environment and with collision detection! But there is a little problem with the coordinates and i don't know why! My real life coordinates are 6 (meters) in the x and 4 in the y coordinate! Thank you! matthias Here is the source: import pygame from pygame.locals import * import ode WIDTH = 900 HEIGHT = 600 srf=None world=None space=None def coord(x,y): "Convert world coordinates to pixel coordinates." xf = WIDTH / 6 yf = HEIGHT / 4 #return int(400+150*x), int(500-150*y) return int(xf * x), int(HEIGHT - (yf * y)) def near_callback(args, geom1, geom2): contacts = ode.collide(geom1, geom2) for c in contacts: c.setBounce(0.5) e = ode.ContactJoint(world, args, c) e.attach(geom1.getBody(), geom2.getBody()) print 'Position of geom1 and block(geom2): ', geom1.getPosition(), geom2.getPosition() print 'Length of the block: ', geom2.getLengths() def doSimulation(body, block): fps = 50 dt = 1.0 / fps loopFlag = True clk = pygame.time.Clock() contgrp = ode.JointGroup() while loopFlag: events = pygame.event.get() for e in events: if e.type == QUIT or e.type == KEYDOWN: loopFlag = False srf.fill ( (255,255,255) ) srf.lock() xv, yv = 3, 4 # block zeichnen x,y,z = block.getPosition() l,h = block.laenge pygame.draw.rect(srf, (0,0,0), (coord(x,y + h), (l * (WIDTH / 6), h * (HEIGHT / 4) )), 0) # bodies zeichnen for i in range(len(body)): x1,y1,z1 = body[i].getPosition() pygame.draw.circle(srf, (50,0,200), coord(x1,y1), int(body[i].radius * (WIDTH/6)) ) pygame.draw.line(srf, (100,0,200), coord(xv,yv), coord(x1,y1), 2) xv, yv = x1, y1 srf.unlock() pygame.display.flip() for i in range(2): space.collide(contgrp,near_callback) world.step(dt / 2) contgrp.empty() clk.tick(fps) # end while def createBody(world, space): radius = 0.2 body = ode.Body(world) mass = ode.Mass() mass.setSphere(2000, radius) body.setMass(mass) geom = ode.GeomSphere(space, radius) geom.setBody(body) body.radius = 0.2 return body def createBlock(space, pos): geom = ode.GeomBox(space, (1.5, 2.5, 0) ) geom.setPosition((4.5,0,0)) geom.setBody(ode.environment) geom.laenge = (1.5, 2.5) return geom if __name__ == '__main__': pygame.init() srf = pygame.display.set_mode( (900,600) ) world = ode.World() world.setGravity( (0,-9.81,0) ) world.setERP(0.5) space = ode.Space() bodies = [] for i in range(3): body = createBody(world, space) body.setPosition((i+4,4,0)) bodies.append(body) joint = ode.BallJoint(world) joint.attach(ode.environment, bodies[0]) joint.setAnchor((3,4,0)) joint2 = ode.BallJoint(world) joint2.attach(bodies[0], bodies[1]) joint2.setAnchor((4,4,0)) joint3 = ode.BallJoint(world) joint3.attach(bodies[1], bodies[2]) joint3.setAnchor((5,4,0)) block = createBlock(space, (4.5,0,0)) doSimulation(bodies, block) |
From: Chris B. <chr...@gm...> - 2005-11-08 10:15:58
|
On 07/11/05, Matthias <Sta...@gm...> wrote: > kx, ky, kz =3D kugel.getPosition() > print kx, ky, kz > pygame.draw.line(srf, (0,0,0), coord(2, 3.8), coord(kx, k= y), 3) > > pygame.draw.rect(srf, (0,100,50), (coord(kx, ky), coord(k= x + 0.1, ky - > 0.1)), 0) from http://www.pygame.org/docs/ref/rect.html#pygame.Rect we find the definition of Rect: pygame.Rect((left, top), (width, height)): return Rect But you used absolute coordinates instead of (width,height) - your rectangle size is shrinking as kx and ky approach the origin! This works better: pygame.draw.rect(srf, (0,100,50), (coord(kx, ky), coord(0.1, 0.1)), 0) Now your next problem is that the joint with the ode.environment doesn't seem to be working. The body is always moving towards the origin. Even if you set the gravity to (0,0,0) it does this. This indicates a prolem with the joint - since the only force in your simulation is generated by ode trying to correct the errors in this joint. The problem is command order, you need to attach the joint before setting the anchor: bj.attach(kugel, ode.environment) bj.setAnchor( (2, 3.8, 0) ) That should fix your problems. Chris |
From: Matthias <Sta...@gm...> - 2005-11-07 22:24:37
|
Hi! I am very new to ODE! I had a look at tutorial 1 and 2, and i wanted to make my own little test sample! The program is very similar to tutorial2 but very selfmade, but it doesnt work! Why? I dont know!! I think there is a problem with the coordinates! I wrote the following code: #! /usr/bin/env python import pygame from pygame.locals import * import ode WIDTH = 800 HEIGHT = 600 def coord(x, y): x = x * (WIDTH / 4); y = HEIGHT - y * (HEIGHT / 4); return x, y def initPygame(): pygame.init() srf = pygame.display.set_mode( (WIDTH, HEIGHT) ) pygame.display.set_caption('Kran Beispiel mittels ODE') return srf def initOde(): world = ode.World() world.setGravity( (0, -9.81, 0) ) return world def makeKugel(w): kugel = ode.Body(w) m = ode.Mass() m.setBox(7900, 0.2, 0.2, 0.3) kugel.setMass(m) kugel.setPosition( (3, 3.8, 0) ) return kugel def drawKran(srf): srf.lock() pygame.draw.rect(srf, (100, 200, 40), (coord(0, 4), coord(2, 3.8)), 0) pygame.draw.rect(srf, (100, 200, 40), (coord(0, 4), coord(0.2, 0)), 0) srf.unlock() if __name__ == '__main__': loop = True fps = 50 dt = 1.0 / fps clk = pygame.time.Clock() srf = initPygame() world = initOde() kugel = makeKugel(world) bj = ode.BallJoint(world) bj.setAnchor( (2, 3.8, 0) ) bj.attach(kugel, ode.environment) while (loop): for e in pygame.event.get(): if (e.type == QUIT): loop = False srf.fill( (255,255,255) ) drawKran(srf) kx, ky, kz = kugel.getPosition() print kx, ky, kz pygame.draw.line(srf, (0,0,0), coord(2, 3.8), coord(kx, ky), 3) pygame.draw.rect(srf, (0,100,50), (coord(kx, ky), coord(kx + 0.1, ky - 0.1)), 0) pygame.display.flip() world.step(dt) clk.tick(fps) if you find the bugs please talk to me like talking to a four year old child (maybe some explanation would be nice ;) )! thanks, Matthias -- Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat, DSL-Flatrate für nur 4,99 Euro/Monat* http://www.gmx.net/de/go/dsl |
From: Paul K. <pki...@in...> - 2005-10-27 22:48:07
|
From memory - you need to keep a global copy of your joint (since pyode doesn't store them). Your joints are potentially being destroyed when drop_object() exists. Paul -----Original Message----- From: pyo...@li... [mailto:pyo...@li...] On Behalf Of Ricardo Kirkner Sent: Friday, 28 October 2005 8:08 AM To: pyo...@li... Subject: [Pyode-user] General question about ode Hi: I am really new to this ode/pyode thing. I am trying to develop a simulation using pyode. I finally made it (using several "borrowed example code" :-)) to have my objects get rendered on screen. They are currently generated a bit above the ground, so when I rendered them, they fall a little (inspired by the pyode tutorial2). I have created a model that consists of two boxes that should be connected through a stick. All three objects get correctly rendered, but they don't keep together (they just split apart as soon as they fall on the ground) The code I am using to created those objects is: ------------------------------------------------------------------------ ----------------------------------------------- def create_box(world, space, density, lx, ly, lz): """Create a box body and its corresponding geom.""" # Create body body = ode.Body(world) M = ode.Mass() M.setBox(density, lx, ly, lz) body.setMass(M) # Set parameters for drawing the body body.shape = "box" body.boxsize = (lx, ly, lz) # Create a box geom for collision detection geom = ode.GeomBox(space, lengths=body.boxsize) geom.setBody(body) return body def drop_object(): """Drop an object into the scene.""" global bodies blockA = create_box(world, space, 1000, 1.0,1.0,1.0) blockB = create_box(world, space, 1000, 1.0,1.0,1.0) link = create_box(world, space, 1000, 1.0, 0.2, 0.2) x, y, z = 0.0, 1.0, 0.0 blockA.setPosition( (x,y,z )) link.setPosition((x+1,y,z)) blockB.setPosition((x+2,y,z)) m = mat4().rotation(0, (0,1,0)) blockA.setRotation(m.toList()) blockB.setRotation(m.toList()) link.setRotation(m.toList()) j1 = ode.HingeJoint(world) j2 = ode.HingeJoint(world) j1.attach(blockA, link) j2.attach(blockB, link) j1.setAnchor((0,0,0)) j2.setAnchor((1,0,0)) j1.setAxis((0,0,1)) j2.setAxis((0,0,1)) j1.setParam(ode.ParamFMax, ode.Infinity) j1.setParam(ode.ParamVel, 0) j2.setParam(ode.ParamFMax, ode.Infinity) j2.setParam(ode.ParamVel, 0) bodies.append(blockA) bodies.append(blockB) bodies.append(link) ------------------------------------------------------------------------ ----------------------------------------------- Maybe someone can help me to get this three objects remain connected all time? Maybe I should have written to the ode mailing list, but since I am writing code in python, I thought of this one. With regards, Ricardo Kirkner |
From: Ricardo K. <ric...@gm...> - 2005-10-27 22:38:38
|
Hi: I am really new to this ode/pyode thing. I am trying to develop a simulatio= n using pyode. I finally made it (using several "borrowed example code" :-)) to have my objects get rendered on screen. They are currently generated a bit above the ground, so when I rendered them, they fall a little (inspired by the pyode tutorial2). I have created = a model that consists of two boxes that should be connected through a stick. All three objects get correctly rendered, but they don't keep together (the= y just split apart as soon as they fall on the ground) The code I am using to created those objects is: ---------------------------------------------------------------------------= -------------------------------------------- def create_box(world, space, density, lx, ly, lz): """Create a box body and its corresponding geom.""" # Create body body =3D ode.Body(world) M =3D ode.Mass() M.setBox(density, lx, ly, lz) body.setMass(M) # Set parameters for drawing the body body.shape =3D "box" body.boxsize =3D (lx, ly, lz) # Create a box geom for collision detection geom =3D ode.GeomBox(space, lengths=3Dbody.boxsize) geom.setBody(body) return body def drop_object(): """Drop an object into the scene.""" global bodies blockA =3D create_box(world, space, 1000, 1.0,1.0,1.0) blockB =3D create_box(world, space, 1000, 1.0,1.0,1.0) link =3D create_box(world, space, 1000, 1.0, 0.2, 0.2) x, y, z =3D 0.0, 1.0, 0.0 blockA.setPosition( (x,y,z )) link.setPosition((x+1,y,z)) blockB.setPosition((x+2,y,z)) m =3D mat4().rotation(0, (0,1,0)) blockA.setRotation(m.toList()) blockB.setRotation(m.toList()) link.setRotation(m.toList()) j1 =3D ode.HingeJoint(world) j2 =3D ode.HingeJoint(world) j1.attach(blockA, link) j2.attach(blockB, link) j1.setAnchor((0,0,0)) j2.setAnchor((1,0,0)) j1.setAxis((0,0,1)) j2.setAxis((0,0,1)) j1.setParam(ode.ParamFMax, ode.Infinity) j1.setParam(ode.ParamVel, 0) j2.setParam(ode.ParamFMax, ode.Infinity) j2.setParam(ode.ParamVel, 0) bodies.append(blockA) bodies.append(blockB) bodies.append(link) ---------------------------------------------------------------------------= -------------------------------------------- Maybe someone can help me to get this three objects remain connected all time? Maybe I should have written to the ode mailing list, but since I am writing code in python, I thought of this one. With regards, Ricardo Kirkner |
From: Diez B. R. <de...@we...> - 2005-10-26 23:10:42
|
Hi, I'm in the process of writing a sort of "generic" ODE application that reads its definition from a xode document. And I try to use two classes - world, and robot - to decompose the xode declarations. Basically, I try to extract the robot's definition from the second xode document and add it to the world. Things work in so far that I can add the xode-Object, and the simulation works in so far that the robots geoms get rendered. But they aren't subject to gravity for example, no collision detection and so on. Has anybody managed to get a similar thing to work and give me some hints? Regards, Diez |
From: Andrew D. <ad...@gm...> - 2005-10-05 05:48:01
|
On 10/4/05, Matthias Baas <ba...@ir...> wrote: > > I couldn't run your code as I don't have PyOgre but it seems the problem > is you store the BallJoint in a local variable which gets deleted at the > end of the method. And as j1 is the only reference to the BallJoint > object the BallJoint is garbage collected when j1 is deleted which will > also delete the underlying ODE BallJoint. To fix this you simply have to > keep a Python reference to the joint (self.j1 =3D ode.BallJoint(...)). Yes, that fixes it -- although it seems a little unnatural. I would have expected that the world would maintain the object, and that PyODE would not delete the joint merely because the Python reference gets collected... Anyway, thanks! I've got a solution now. |
From: Paul K. <pki...@in...> - 2005-10-04 04:20:16
|
Hi I'm trying to compile PyODE on gcc 4 (Darwin). I've had a few problems. Firstly - it appears you need to compile with g++ rather than gcc. Secondly, when I try to "import ode", in python, I get an error: ImportError: Loaded module does not contain symbol _initode2 Does anyone know how to fix this? Paul |
From: Matthias B. <ba...@ir...> - 2005-10-03 20:33:04
|
Andrew Durdin wrote: > # Connect body1 with the static environment > j1 = ode.BallJoint(self.world) > j1.attach(body1, None) > j1.setAnchor((0, 200, 0)) I couldn't run your code as I don't have PyOgre but it seems the problem is you store the BallJoint in a local variable which gets deleted at the end of the method. And as j1 is the only reference to the BallJoint object the BallJoint is garbage collected when j1 is deleted which will also delete the underlying ODE BallJoint. To fix this you simply have to keep a Python reference to the joint (self.j1 = ode.BallJoint(...)). - Matthias - |
From: Matthias B. <ba...@ir...> - 2005-10-03 20:29:13
|
Gabriel Beloin wrote: > So I'm limited in the number of bodies i can include in the same space? As far as I could see, the crash seems not to be related to the Python binding but ODE itself. The crash happens in the quickStep() method which does nothing but call the corresponding ODE C function. Have you tried to visualize the simulation up to the crash to see what event triggers it? Is it when the boxes hit the ground? Maybe there are too many contacts then (which might result in a stack overflow)...? You could try not to use all the contacts in the near callback to reduce the number of contact joints. - Matthias - |
From: Andrew D. <ad...@gm...> - 2005-10-03 02:58:34
|
Hi everyone, I'm experimenting with PyODE and PyOgre at the moment, and have been working through PyODE's Tutorial 2 (two bodies connected with ball joints to form a compound pendulum). I've tried to rewrite Tutorial 2 using PyOgre instead of PyGame. I'd managed to get an ogre head to fall under gravity without trouble, but attempting to attach the head to a joint (with the other end fixed), the joint seems to be completely ignored, with the head merely falling and not swinging as it ought. I can't see at all what I'm doing wrong here -- can anyone help me? Here's the code: import pyogre.ogre as ogre import SampleFramework as sf import ode class TutorialApplication(sf.Application): def __init__(self): sf.Application.__init__(self) # Set up the physics world self.world =3D ode.World() self.world.setGravity((0, -9.81, 0)) self.bodyList =3D [] def _createScene(self): sm =3D self.sceneManager # Set up the lighting conditions sm.ambientLight =3D (0.7, 0.7, 0.7) # Create a disembodied ogre head e =3D sm.createEntity("OgreHead", "ogrehead.mesh") n =3D sm.rootSceneNode.createChildSceneNode() n.attachObject(e) pos =3D (100, 200, 0) n.position =3D ogre.Vector3(*pos) body1 =3D ode.Body(self.world) M =3D ode.Mass() M.setSphere(2500, 0.05) body1.setMass(M) body1.setPosition((100, 200, 0)) # Add it to the body list self.bodyList.append((body1, n)) # Connect body1 with the static environment j1 =3D ode.BallJoint(self.world) j1.attach(body1, None) j1.setAnchor((0, 200, 0)) def _createFrameListener(self): """Creates the FrameListener.""" self.frameListener =3D PhysicsFrameListener(self.renderWindow, self.camera, self.world, self.bodyList) self.frameListener.showDebugOverlay(True) self.root.addFrameListener(self.frameListener) class PhysicsFrameListener(sf.FrameListener): def __init__(self, renderWindow, camera, world, bodyList): sf.FrameListener.__init__(self, renderWindow, camera) self.world =3D world self.bodyList =3D bodyList self.time =3D 0.0 self.dt =3D 0.08 def frameStarted(self, frameEvent): # Step the physics self.world.step(self.dt) self.time +=3D self.dt if False: body =3D self.bodyList[0][0] x,y,z =3D body.getPosition() u,v,w =3D body.getLinearVel() print "%1.2fsec: pos=3D(%6.3f, %6.3f, %6.3f) vel=3D(%6.3f, %6.3f, %6.3f)" % \ (self.time, x, y, z, u,v,w) # Update the positions of objects for body, node in self.bodyList: pos =3D body.getPosition() node.position =3D ogre.Vector3(*pos) return sf.FrameListener.frameStarted(self, frameEvent) if __name__ =3D=3D "__main__": app =3D TutorialApplication() app.go() |
From: Paul K. <pki...@in...> - 2005-09-29 00:53:38
|
Hi I was wondering if anyone had been able to compile PyODE for the Mac. I've compiled ODE with gcc (3.3 I think), however the Distutils that the PyODE build uses wants to compile the ode files from Pyrex using Metrowerks Codewarrior 7 (which I don't have, and which appears to not be supported any more - judging by the Metrowerks website). Paul |
From: <th...@po...> - 2005-09-27 07:29:35
|
> Are you sure that vert and ind do carry=20 > correct values?=20 Thanks for your answer, I just figured out that I got a stupid error in cre= ating my set of indices. Now it works good, but slow... :( But I can surely= decrease my vertices set and I hope it'll be ok then.=20 Przemek ---------------------------------------------------------------------- Jestem niesamowita... ;-) >>> http://link.interia.pl/f18b8 |
From: Gabriel B. <gb...@ne...> - 2005-09-26 16:46:21
|
Hi everybody, I'm Gabio from the Blender community. Artist and python coder. Blender is an opensource 3D package using python as main scripting language. The API is accessible here:http://www.blender.org/modules/documentation/237PythonDoc/frames.html . I recently tried to simulate some tests scenes in Blender using the pyODE module. And it worked relatively well. I got a problem though. A crash to be more correct, when having a lot of bodies in the same space. The fact is I want all of them to be able to collide. I'm not aware ODE have limit in the number of collisions it can manage. To test it out. you can get Blender 3D @ www.blender.org. have python 2.3 installed and pyODE. Then download this file: http://web.netrevolution.com/gbeloin/ODE_bug_gabio.blend You can open it in Blender by pressing F1 and browsing to the .blend file or double click on it (Windows) You will then face a screen with the scene (plane and ball) and a script windows on the right. to start the test move your mouse cursor in the text windows and press ALT-P. for me it crash. in the near_callback. and the debug give me a stack overflow. If you go at line 95 and change "for x in range(20):" to "for x in range(5):" the script doesn't crash anymore. you then can see the anim by moving your mouse in the 3Dspace on the left and pressing ALT-A. or you can see the result of the best i could get out of pyODE before crash: http://media.putfile.com/Render_legowall0001_0200 So I'm limited in the number of bodies i can include in the same space? Of course if you don't feel like downloading Blender and python 2.3, I've made an example you can run on any system with pyODE. The crash is instant: -------------------------------------- import ode def draw_body(body): global frame x,y,z = body.getPosition() print x,y,z # Collision callback def near_callback(args, geom1, geom2): """Callback function for the collide() method. This function checks if the given geoms do collide and creates contact joints if they do. """ # Check if the objects do collide contacts = ode.collide(geom1, geom2) # Create contact joints world,contactgroup = args for c in contacts: c.setBounce(.5) c.setMu(7000) j = ode.ContactJoint(world, contactgroup, c) j.attach(geom1.getBody(), geom2.getBody()) # Create a world object world = ode.World() world.setGravity((0,0,-9.81)) world.setERP(0.2) #error correction world.setCFM(1E-10) #softness of collision lobj = [] lbody = [] contactgroup = ode.JointGroup() print "Create a space object" space = ode.Space() print "Create a plane geom which prevent the objects from falling forever" floor = ode.GeomPlane(space, (0,0,1), 0) print "create array" a = 1.5 for z in range(20): for x in range(20): lobj.append((x*3+a,1,z+.5)) for obj in lobj: body = ode.Body(world) M = ode.Mass() M.setBox(5000,3,1,1) body.setMass(M) body.setPosition(obj) geom = ode.GeomBox(space,(3,1,1)) geom.setBody(body) lbody.append(body) body.disable() #wait for the cue bball = ode.Body(world) M = ode.Mass() M.setSphere(700,5) bball.setMass(M) bball.setPosition((9,-19,5)) geom2 = ode.GeomSphere(space,5) geom2.setBody(bball) bball.setLinearVel((0,20,0)) #give some speed. lobj.append((9,-19,5)) lbody.append(bball) print "Simulation loop..." fps = 24 dt = 1.0/fps frame = 1 #first frame totframe = 300 while frame < totframe: #tot of frame to do for i in range(2): space.collide((world,contactgroup), near_callback) #colision for b in range(len(lbody)): draw_body(lbody[b]) world.quickStep(dt) #shift time contactgroup.empty() #empty mem frame += 1 ode.CloseODE() print "done!" ------------------------- Thanks for looking. |
From: Matthias B. <ba...@ir...> - 2005-09-26 15:31:18
|
th...@po... wrote: > trimesh=ode.TriMeshData() > trimesh.build(vert,ind) > trimeshgeom=ode.GeomTriMesh(trimesh,space) So far, this looks fine to me. Are you sure that vert and ind do carry correct values? (each item in vert should be a sequence of 3 floats and each item in ind should be a sequence of 3 ints) Have you tried reverting the order of the vertices per face to flip their direction? (but I'm not sure if this makes a difference in ODE/Opcode anyway) - Matthias - |
From: Matthias B. <ba...@ir...> - 2005-09-26 15:19:33
|
Jean de Largentaye wrote: > I think this would be quite useful for people who can't / don't want > to install cgkit, because cgkit1 doesn't exist in a packaged form for > python2.4, or they're afraid to try to replace it with cgkit2 (oooh, > 'alpha'! fear!). After all, reducing dependancies is a Good Thing, no? Even though I'm biased I do agree with you. :) I'm sorry that you had to spend your time on that, it actually wouldn't have been necessary because this work has already been done before. Pierre Gay has already sent me a version where he removed the dependency on cgkit and pygame (using GLUT instead which is part of PyOpenGL). We just haven't had the time yet to update the web site and cvs repository. My apologies for that. (By the way, your version doesn't run over here (Python 2.3, WinXP). I get a segmentation fault by pygame right after the window pops up... maybe it has something to do with the PyOpenGL binary using numarray instead of Numeric...?) Thanks for your efforts anyway, and sorry again that it has already be done but not posted yet... - Matthias - |
From: Matthias B. <ba...@ir...> - 2005-09-26 14:45:51
|
Chris Bainbridge wrote: >>The tutorial is *not* referring to AMotors but to the internal motors of >>the joints (which a ball joint doesn't have). > > Do you mean you can't just set ParamVel and ParamFMax on a ball joint? > You have to use an AMotor? I didn't know that.. don't remember seeing > it in the manual. See section 7.5.1 "Parameter Functions" in the ODE manual (http://www.ode.org/ode-latest-userguide.html#sec_7_5_1). This sections lists the functions to get/set the limit/motor parameters for each joint type and there is no get/set function for a ball joint. - Matthias - |
From: <th...@po...> - 2005-09-26 07:16:38
|
Hi, I have problems with setting up collision between GeomTriMesh and GeomSpher= e. I have a list called "verts" with my vertices and a list called "ind" wi= th indices. It look that they're ok, because it is drawn as I want it to be= drawn with glVertexPointer/glDrawElements.=20 That's all about trimesh geom in my code: trimesh=3Dode.TriMeshData() trimesh.build(vert,ind) trimeshgeom=3Dode.GeomTriMesh(trimesh,space) And then I place a sphere over it and it just falls through the mesh, witho= ut any collision (of course sphere has it's body and geom). What should i d= o to make this work? Should the indices or vertices be in some specific ord= er? I took the collision callback function from Tutorial 3. Greets, Przemek Muller ---------------------------------------------------------------------- Sa niesamowite, zobaczysz... ;-) >>> link http://link.interia.pl/f18b9 |
From: Jean de L. <jla...@gm...> - 2005-09-25 21:31:27
|
Hi folks! I rewrote the tut3 for myself to work without cgkit. I work with python 2.4, and there's no package of cgkit1 for this, at least on Debian... Furthermore, I couldn't get cgkit2 to work as a drop-in replacement (some C++ ABI errors I forgot), so I decided to see if I could remove it completely, and succeeded. I think this would be quite useful for people who can't / don't want to install cgkit, because cgkit1 doesn't exist in a packaged form for python2.4, or they're afraid to try to replace it with cgkit2 (oooh, 'alpha'! fear!). After all, reducing dependancies is a Good Thing, no? OK, maybe not for tutorials where you want things to be as clear as possible. But I think it would be interesting to give it as an alternate download for those who are frustrated by the dependancies (as I was). The result is slightly less tidy than the original. An additional requirement is to import Numerical. But since that package is a requirement for PyOpenGL which is already used, I don't think that's a problem. I had to add a small function that flattens a Numerical.array object, since the included array.tolist() function doesn't do it correctly, at least for our use. If you run down the sources, I have added comments "#use this..." and "#instead of this" to show what I have replaced (hint: "use.." precedes the new part, and "instead" precedes the old part). in Prepare_GL(), it's actually shorter to use the libraries included functions gluPerspective() and gluLookAt(). As we're alrady importing GLU, why not use them? in draw_body(), I directly worked with the flattened matrix returned by getRotation(). Nothing to see here... In drop_object(), I used GL's matrix operations to make and retrieve the rotation matrix, then my flatten function I mentioned above to put that with setRotation() In explosion, I basically extracted the length() and normalize() functions from vec3 :) Same for inside pull() Oh, and in the meantime, the Debian package isn't getting anywhere. All of a sudden, having pyode already installed removes most of the incentive :( And a last thing: it's late, it's possible (probable) I'm blathering nonsense somewhere (everywhere). Be kind ;) John |
From: Timothy S. <str...@ma...> - 2005-09-21 09:24:17
|
On Tue, 2005-09-20 at 13:21 +0200, Jean de Largentaye wrote: > Furthermore, I'm a bit motivated to make a debian package of PyODE. I > wonder if there have been previous efforts in that direction? I don't believe anyone has attempted to build a Debian package so far although there have certainly been people interested in having one. I use Gentoo so I won't be of much help. An Autopackage[1] package might be a good idea for the next release; that should suit most people. [1] http://autopackage.org/ -- Timothy Stranex <str...@ma...> |
From: Chris B. <chr...@gm...> - 2005-09-20 17:07:25
|
On 20/09/05, Matthias Baas <ba...@ir...> wrote: > The tutorial is *not* referring to AMotors but to the internal motors of > the joints (which a ball joint doesn't have). Do you mean you can't just set ParamVel and ParamFMax on a ball joint? You have to use an AMotor? I didn't know that.. don't remember seeing it in the manual. On 20/09/05, Paul Kinnane <pki...@in...> wrote: >=20 > Converting this to UserMode resulted in the limits not working at all. > I was unable to find the problem. My guess is that there is an issue > with PyODE's AMotor.setNumAxes or setAngle, but I couldn't track it > down. This post (1) on the ode list has code for user mode ball joints with working limits (though I haven't tested it). (2) says there are some problems though - it sounds like ODE only considers the limit in the direction the joint is moving towards, instead of trying to satisfy both limits at the same time. (1) http://q12.org/pipermail/ode/2005-August/016510.html (2) http://q12.org/pipermail/ode/2005-July/016474.html |
From: Matthias B. <ba...@ir...> - 2005-09-20 15:57:19
|
Jean de Largentaye wrote: > A little note though: on deb, the compiler is called > 'python2.x-pyrexc' (where x={3,4}), not 'pyrexc', so I had to make > that trivial change to the setup script. Would a variable carrying the name of the pyrex executable at the top of the setup script already be acceptable? (you'd still have to modify that manually then) > Furthermore, I'm a bit motivated to make a debian package of PyODE. I > wonder if there have been previous efforts in that direction? Not that I knew of, but I'm mainly using Windows anyway, so maybe Timothy knows something...? > Anyhow, > I might need some help, as I'm a bit new to PyODE and this would be > the first time I make a deb package ;) Thanks for your effort, I'd suggest to post any problems right here... - Matthias - |
From: Matthias B. <ba...@ir...> - 2005-09-20 15:45:14
|
Chris Bainbridge wrote: > Has anyone successfully got AMotors to work with universal or ball > joints? According to the 2nd pyode tutorial, they won't work. The tutorial is *not* referring to AMotors but to the internal motors of the joints (which a ball joint doesn't have). > mailing list have claimed to have it working. I notice that the > ParamX3 definitions are missing from the pyode wrappers - is this > deliberate? No. They're in there now, I've just checked it in. (but as was already mentioned, you can just add 256 to the ParamX2 values to get the ParamX3 values (or add 512 to ParamX)) >>From my own tests, in User Mode I can't get the AMotor to do anything. > In Euler mode only the 2nd axis control (ParamVel, ParamFMax2) seems > to have any effect, the other axis controls don't do anything. > > Any ideas? I have never used AMotors so far, so I'm afraid I can't help you there right now... but it looks as if this is actually an ODE issue and not really limited to PyODE (so asking in the ODE mailing list might a good idea, too). Paul Kinnane wrote: > Converting this to UserMode resulted in the limits not working at all. > I was unable to find the problem. My guess is that there is an issue > with PyODE's AMotor.setNumAxes or setAngle, but I couldn't track it > down. These methods do nothing but call the appropriate ODE C function, so I'd say the problem is already located in ODE itself... > can't use setAngle, and 2) you can't create a limit between a body and > the environment (well I couldn't work out how to do it anyway) since > am.setAxis(2, 2, [0, 0, 1]) fails if the second body is the > ode.environment. ode.environment is not an actual body but is just an alias for None. Connecting to the environment is just like calling the ODE C function with a second body argument of 0. Obviously the AMotor requires a real second body... - Matthias - |
From: Jean de L. <jla...@gm...> - 2005-09-20 11:21:19
|
Hi folks, I just wanted to point out that the PyODE 1.1.0 distribution won't compile on gcc-4 based systems, ie those where 'gcc' is gcc 4 (like debian unstable, for example). This comes from the ode_[no]trimesh.c files, generated by pyrex 0.9.3, that are included. This is a known problem with pyrex 0.9.3, it seems. There is a new upstream release of pyrex that solves this problem. Maybe it'd be a good idea to make a minor PyODE release with the corrected ode_[no]trimesh.c files? Debian uses a patched version of 0.9.3 that already fixes the gcc 4 problem, so it should be enough to remove those 2 C files and let the system's pyrex rebuild them. This is what worked for me. A little note though: on deb, the compiler is called 'python2.x-pyrexc' (where x=3D{3,4}), not 'pyrexc', so I had to make that trivial change to the setup script. Furthermore, I'm a bit motivated to make a debian package of PyODE. I wonder if there have been previous efforts in that direction? Anyhow, I might need some help, as I'm a bit new to PyODE and this would be the first time I make a deb package ;) cheers, John |
From: Chris B. <chr...@gm...> - 2005-09-20 09:59:39
|
On 20/09/05, Paul Kinnane <pki...@in...> wrote: > I got AMotor limits working in Euler Mode. Do you know if ParamVel / ParamFMax work on all 3 axes in your setup? |