[pymunk] Add two wheels to my robot

Official forum for the Chipmunk2D Physics Library.
Post Reply
ynovella
Posts: 3
Joined: Tue Feb 15, 2011 6:44 am
Contact:

[pymunk] Add two wheels to my robot

Post by ynovella »

Hi,

I am working on a simulator for my robot and I have problems adding wheels to it...
The robot is viewed from above ( it's just a box) and I want to add wheels at two of its corners... Each wheel can rotate over 360 degrees independently, each wheel can be represented by a segment. I tried to attach them two the body of the robot with a Pin joints but is seems that I can't add the wheels "inside" the robot... Here's a picture of what I want :
robot.png
I imagine that if the wheels have a velocity they will move to robot with them... am I right ? On the real robot this design works fine, the robot is able to move sideways and all... Any Ideas ??

Thank you !
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: [pymunk] Add two wheels to my robot

Post by slembcke »

When you say that you can't add them inside the robot, you mean because they collide with it? Use the group property of the shapes to filter out the collisions. Set them all to be in the same numbered group.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
ynovella
Posts: 3
Joined: Tue Feb 15, 2011 6:44 am
Contact:

Re: [pymunk] Add two wheels to my robot

Post by ynovella »

Ah yes... of course ! Thanks !
And do you think PinJoint is the most appropriate in my situation ?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: [pymunk] Add two wheels to my robot

Post by slembcke »

Oh, I missed that. It looks like you probably want a pivot joint instead if I understand what you are trying to do. If you are using a 0-length pin joint, then you definitely want a pivot joint.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
ynovella
Posts: 3
Joined: Tue Feb 15, 2011 6:44 am
Contact:

Re: [pymunk] Add two wheels to my robot

Post by ynovella »

Yeah I used a 0 length pin joint, thanks for the advice :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests