Example of Joint-Target-Position command
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Example of Joint-Target-Position command
Hello! Would there be a sample scene I could look at to see how the command sim.setJointTargetPosition works? Thank you.
Re: Example of Joint-Target-Position command
What CoppeliaSim version and revision do you have?
e.g. take the model Models/robots/non-mobile/KUKA LBR iiwa 14 R820.ttm, open the child script attached to it an replace it with:
With the last revision, you can now also control a joint that is in kinematic mode with sim.setJointTargetPosition.
See also the demo scene scenes/motorControllerExamples.ttt
Cheers
e.g. take the model Models/robots/non-mobile/KUKA LBR iiwa 14 R820.ttm, open the child script attached to it an replace it with:
Code: Select all
function sysCall_init()
local jointHandle=sim.getObject('./link2_resp/joint')
sim.setJointTargetPosition(jointHandle,45*math.pi/180)
end
See also the demo scene scenes/motorControllerExamples.ttt
Cheers
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Example of Joint-Target-Position command
Thanks. I will check this out.
Besides, I also would like to know how are revolute joints generally manipulated using Lua code, including specifics like how many degrees it can rotate and how fast it rotates?
Would the KUKA robot mentioned in the previous message have a demo of that already, or are there more that can be suggested? Please and Thanks.
Besides, I also would like to know how are revolute joints generally manipulated using Lua code, including specifics like how many degrees it can rotate and how fast it rotates?
Would the KUKA robot mentioned in the previous message have a demo of that already, or are there more that can be suggested? Please and Thanks.
-
- Posts: 49
- Joined: 26 Oct 2021, 01:35
Re: Example of Joint-Target-Position command
To briefly answer the version question, I am using 4_3_0.
Re: Example of Joint-Target-Position command
You can adjust all those dynamic properties in the joint dynamic properties dialog. Joint range and similar can be adjusted in the joint dialog.
Cheers
Cheers