the dynamic parameters of the robots

Typically: "How do I... ", "How can I... " questions
Post Reply
ccheng292
Posts: 7
Joined: 21 Apr 2022, 14:13

the dynamic parameters of the robots

Post by ccheng292 »

Question1: I want to construct a manipulator in Coppeliasim by Denavit Hartenberg convention. What should I do and how can I add dynamic parameters? such as mass, Center Of Gravity and inertia.

Question2: For predefined models in Coppeliasim, if I want to get the dynamic propeties, I can get this via the shape dynamics dialog. But are the center of gravity and inertia depicted in corresponding coordinate of link?The center of gravity may be depicted in the coordinate of world. I want the center of gravity and inertia depicted in corresponding coordinate of link.

Question3: The Denavit Hartenberg parameter obtained by ’models/tools/Denavit Hartenberg parameter extractor.ttm‘ is standard DH parameter or improved DH parameter.

Best wishes.

coppelia
Site Admin
Posts: 10379
Joined: 14 Dec 2012, 00:25

Re: the dynamic parameters of the robots

Post by coppelia »

Hello,

have a look at [Menu bar --> Modules --> Denavit-Hartenberg --> Creator]. Those are standard DH parameters as far as I know.

To change dynamic parameters, you can do this via the GUI and the shape dynamics dialog, or programatically, via, e.g. sim.setShapeMass, sim.setShapeInertia

In the shape dynamics dialog, you will see the inertia frame relative to the reference frame of the shape. So basically: absInertiaFrame=shapeFrame*localInertiaFrame

The localInertiaFrame is expressed via a position (x,y,z) and an orientation (alpha,beta,gamma). The inertia in that frame is always diagonal.

Cheers

ccheng292
Posts: 7
Joined: 21 Apr 2022, 14:13

Re: the dynamic parameters of the robots

Post by ccheng292 »

Thanks for your help.
The center of gravity may be depicted in the coordinate of world in the shape dynamics dialog. But you know, when constructing a manipulator, we want the center of gravity of every link depicted in every link. And if I change the center of gravity in the shape dynamics dialog, it may be not at the link.

Best wishes

coppelia
Site Admin
Posts: 10379
Joined: 14 Dec 2012, 00:25

Re: the dynamic parameters of the robots

Post by coppelia »

If you use the matrix dialog to specify your inertia, then everything is relative to world coordinates.
Typically, you would temporarily place the shape onto the origin, if you needed to specify a relative matrix via that dialog, then place it back into the desired position/orientation in the robot.

Cheers

ccheng292
Posts: 7
Joined: 21 Apr 2022, 14:13

Re: the dynamic parameters of the robots

Post by ccheng292 »

Thanks for your help
I use 'Rigid Body Dynamic Properties --> inertia Matrix& Center of Mass 'to get the inertia and center of mass of every link. When I move the whole manipulator, the inertia of every link won't change but center of mass of every link will change. The inertia of every link is relative to the reference frame of the shape but center of mass is relative to world coordinates. I want get the center of mass relative to the reference frame of the shape.
You said I could temporarily place the shape onto the origin. But if i did so, the center of mass is at the origin of the world frame. How can i get the center of mass in corresponding coordinate of link?
Is there any tutorial about contructing a manipulator and setting dynamic parameters programatically?
Best wishes

coppelia
Site Admin
Posts: 10379
Joined: 14 Dec 2012, 00:25

Re: the dynamic parameters of the robots

Post by coppelia »

In order to set-up things programmatically, you can use following API functions: sim.setObjectMatrix / sim.setObjectPose / sim.setObjectPosition / sim.setObjectOrientation / sim.setObjectQuaternion, sim.setObjectMass, sim.setObjectInertia, sim.setObjectParent

Above allows to place a shape relative to any frame you want. Place a cuboid into the scene (make sure that it is dynamic). Then click [Richt click --> view --> visualize inertias]. Then you can see what you are doing.

e.g. in order to set the inertia (and center of mass) at the exact same position/orientation as the shape's frame, do:

Code: Select all

function sysCall_init()
    local self=sim.getObject('.')
    local mass=1
    local inertiaMatrix={1,0,0,0,1,0,0,0,1}
    local relativeInertiaFrame=sim.buildMatrix({0,0,0},{0,0,0})
    sim.setShapeInertia(self,inertiaMatrix,relativeInertiaFrame)
    sim.setShapeMass(self,mass)
end
if you want it to be rotated by 45 degrees around the shape's Z-axis:

Code: Select all

function sysCall_init()
    local self=sim.getObject('.')
    local mass=1
    local inertiaMatrix={1,0,0,0,1,0,0,0,1}
    local relativeInertiaFrame=sim.buildMatrix({0,0,0},{0,0,45*math.pi/180})
    sim.setShapeInertia(self,inertiaMatrix,relativeInertiaFrame)
    sim.setShapeMass(self,mass)
end
if you want to set the inertia (and center of mass) relative to the world reference frame, do:

Code: Select all

function sysCall_init()
    local self=sim.getObject('.')
    local mass=1
    local inertiaMatrix={1,0,0,0,1,0,0,0,1}
    local shapeMatrixInverted=sim.getObjectMatrix(self,-1)
    sim.invertMatrix(shapeMatrixInverted) -- invert the matrix
    local absInertiaFrame=sim.buildMatrix({0,0,0},{0,0,45*math.pi/180})
    sim.setShapeInertia(self,inertiaMatrix,sim.multiplyMatrices(shapeMatrixInverted,absInertiaFrame))
    sim.setShapeMass(self,mass)
end
Cheers

Post Reply