Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Revolute joint help for newbie?

Author
Message
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 9th Dec 2009 03:03
Hi, all.

I apologize if this has been asked before, but I couldn't find it on this forum or via Google.

I'm trying to model a mechanism (a walker robot) that uses servo motors, using the revolute joint motors in Dark Physics. I have the model created and the joints attached (correctly, near as I can tell), but the joint motors don't seem to be resettable -- once they are given a direction and max torque, that's what they continue to do.

Is there some trick that I'm missing? Surely these motors can be commanded to reverse direction and/or change speeds or torques, right?

I tried using springs instead, but got similar results: all of the spring declarations seemed to work additively. Instead of redefining the spring null position and constant, I ended up with two competing springs on one joint (I think).

Also, is there an easy way to get the angle of a revolute joint and put it back into a variable? This would be useful, for instance, for modeling servo behavior.

Thanks in advance!
--Eric
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 9th Dec 2009 11:05 Edited at: 9th Dec 2009 11:08
I made this sample code to help in another tread with turret angles, but this seems to be what you might need. Uses a revolute joint and works like a stepper/servo motor where you set the target angle and it travels to that angle by the shortest angular path.

Edit: noticed it uses EZ Rotate.



Regards
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 9th Dec 2009 18:50
Thanks! If I need to get EZRotate, that's a small price to pay. I'll try it out as soon as the purchase goes through.

Thanks!
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 10th Dec 2009 15:44
Well, I got EZRotate and tried to run the example, but it still doesn't appear to be working properly. If I'm reading it right, it should spin the turret to a random angle, setting the torque proportional to the angle error. The problem is that "phy set rigid body angular velocity" doesn't appear to take any torque values, according to the syntax help.

I think the problem might be that EZRotate doesn't know which object to work with. The line "EZro_SetupFromObject 1" wasn't recognized, even after EZRotate Enhanced was installed. Is this a version-related problem? It's difficult for me to tell which version of DBPro I have (bought the Dark Game Studio bonanza deal, upgraded to 7.4 via the website, and bought/installed the EZRotate add-on.)

Thanks in advance for any help you can provide. I'm looking through the EZRotate documentation now, but I'm probably overlooking something simple (I hope).
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 10th Dec 2009 17:26
Hmm...

The included EZRotate demos don't seem to work, either. It looks like somehow the documentation I got (and the auto keyword help) are from EZRotate version 4, but only an earlier version (that doesn't understand SetupFromCamera or SetupFromObject) is actually supported.

Is "EZRotate Enhanced" equal to Version 3, Version 4, or something else -- and is it the right version that I need in order to be able to use code like Duke provided above (since that looks like just the sort of thing I need).

Thanks, and sorry for the confusion. I think if I can get Duke's turret demo working, I'll be good to go...
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 12th Dec 2009 02:43 Edited at: 12th Dec 2009 02:44
Ouch, well i certainly didn't intend for you to fork out on EZ rotate just to get this working, sorry .

It can probably be converted to use standard DB Pro object angle commands to get the origin angles for the objects in some fashion. The person originally needing help with the revolute joint turret used EZ rotate though, so i adapted his code.

However as you have EZ rotate you have to get it to work with the demos before you can move on. I can't help you there i'm afraid, keywords that are not recognized seems to indicate something is wrong with the installation?

Regards
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 12th Dec 2009 02:46
No problem -- EZRotate looks like something I'd have picked up anyway; well worth the $20. The angle commands your code uses are just what I need (if I can get it to work properly), and I didn't see a good way to do that with just the standard physics commands. Thanks again for the example. I'm planning to try a reinstall this weekend (maybe on a different box; my desktop has a bit more horsepower) and see how it goes.
FlyByPC
14
Years of Service
User Offline
Joined: 27th Nov 2009
Location: Philadelphia, PA
Posted: 13th Dec 2009 23:41
I just reinstalled Dark Game Studio, Dark Physics, and EZRotate on my desktop, and the turret demo is working!

Now to try to use this on the original problem...

Login to post a reply

Server time is: 2024-05-04 07:40:13
Your offset time is: 2024-05-04 07:40:13