I need to set position / velocity mode via Lua code (not via the GUI) because I want to be able to switch between these modes.
1)
It seems like I need this parameter from joint reference
"sim.jointfloatparam_dynctrlmode
int32 parameter: the dynamic control mode of the joint"
But it does not seem that the parameter is available to be set because when I query the parameter I get an error. I tried this:
print(sim.getObjectInt32Param(joint,sim.jointfloatparam_dynctrlmode))
where joint is the handle of a joint that has already been defined. This code returns an error.
2)
There are different modes for the joint, free, position, torque, velocity. How to set these modes via code? I am using Lua.
Set position/velocity control mode via code
Re: Set position/velocity control mode via code
Hello,
it is not sim.jointfloatparam_dynctrlmode, but sim.jointintparam_dynctrlmode¨
e.g.:
Cheers
it is not sim.jointfloatparam_dynctrlmode, but sim.jointintparam_dynctrlmode¨
e.g.:
Code: Select all
local m=sim.getObjectInt32Param(jointHandle,sim.jointintparam_dynctrlmode)
print("mode:",m)
local m=sim.setObjectInt32Param(jointHandle,sim.jointintparam_dynctrlmode,sim.jointdynctrl_position)
local m=sim.getObjectInt32Param(jointHandle,sim.jointintparam_dynctrlmode)
print("mode:",m)