Page 1 of 1

Changing Pybullet connection from GUI to DIRECT breaks the robot control

Posted: Sat Sep 05, 2020 1:57 am
by srkiyengar
Hi Guys,

I have a working code with GUI connection where SetJointMotorControlArray() is used to change the position and orientation of the joints in position control mode. It works well and the changes can be confirmed by the position/orientation from getlinkState() and the joint state information from getJointstate().

When I change the connection to DIRECT, I suspect that SetJointMotorControlArray() is not working at all. The getJointstate() returns tuple with all 0.0. Also the getLinkstate() doesn't show any change.

Any ideas or suggestions or thoughts on what factors might influence the change in Pybullet behaviour from GUI to DIRECT.

Thanks.

Re: Changing Pybullet connection from GUI to DIRECT breaks the robot control

Posted: Sun Sep 06, 2020 1:13 pm
by srkiyengar
The issue is resolved, an error on my part. I had the p.stepSimulation() in the wrong place..

Re: Changing Pybullet connection from GUI to DIRECT breaks the robot control

Posted: Fri Jul 23, 2021 2:44 pm
by mat
Dear @Srkiyengar,
I have the same Problem. Everything is working fine in GUI mode but it is not controlling the robot in DIRECT mode.
Do you have an example code how you have solved your problem?

Re: Changing Pybullet connection from GUI to DIRECT breaks the robot control

Posted: Thu Mar 24, 2022 2:56 pm
by cemr
@mat

When using DIRECT mode, you need to manually call p.stepSimulation() in your main loop - I had the same issue, and this is what resolved it for me.

Hope this helps!