Export Joint Angles of assembled components

Export Joint Angles of assembled components

Anonymous
Not applicable
747 Views
3 Replies
Message 1 of 4

Export Joint Angles of assembled components

Anonymous
Not applicable

I have modeled and assembled my 7 dof Modular Robotic Arm and want to export the joint angles to a file or through serial port to directly control a robot. All I need is to get all the joint angles of my robot at a certain position. I noticed that there are joint angles represented while I am moving my bot in model space. That is exactly the angles I need. Please refer to the Image below.need help.jpg

0 Likes
Accepted solutions (2)
748 Views
3 Replies
Replies (3)
Message 2 of 4

goyals
Autodesk
Autodesk
Accepted solution

May be you can get all joints from root component and then iterate over each join to get the angle. I have not verified but below script might work

app = ask.core.Application.get()

root = app.activeProduct.rootComponent

joints  = root.joints

for joint in joints:

   angle = joint.angle

 

If you want angle of a specific joint then may be you can name your joint using name property then during iteration only look for joint with a particular name.

 



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 4

Anonymous
Not applicable
Accepted solution

Thank you so much for the reply. It is important to note though that if you made your joints using as built joints, you must use for joints in .asBuiltJoints: instead. It is what happened to my code which did not work at first until I change the syntax. Now on to sending the angles through serial port for online robot control.

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hello,

did you manage to create a script to export the joint angles.

I would be very interested to use this script.

Thanks

0 Likes