We have a custom robot which has been simulated within Pybullet and works very well. I notice that when I started using calculateInverseKinematics() calls within my scripts, the scripts would fail and also crash Python. The environment is MacOS Catalina (10.15.5), the Python version is 3.6.10 (Anaconda) and Pybullet version is 2.8.7.
Here I have provided a simple script sample which crashes as I execute the step. In other scripts I have seen the calls to the function calculateInverseKinematics() work but Python will die after the successful execution of the step. I am running the scripts within Pycharm.
import pybullet as p
When Python quits, it generates a problem report which is many pages long but the following statements are found in the very beginning:
Code: Select all
def test_IK(this_robot): link_name = "left_eye_joint" idx1 = this_robot.jointDict[link_name] # joint ID, an int pos = list(this_robot.initPosOrn[idx1][this_robot.POS_IDX]) # list of three floats quat1 = [0.0,0.0,0.0871557,0.9961947] # axis (0,0,1) angle 10 degrees joints_pos = p.calculateInverseKinematics(this_robot.linkage, idx1, pos, quat1) #this_robot.linkage is the return value from p.loadURDF(). return joints_pos
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
python(40868,0x700007e23000) malloc: *** error for object 0x3f95a8b47e44471a: pointer being freed was not allocated.
Any suggestions or ideas on what may be causing it. Wondering if someone else has experienced similar problem after calls to calculateInverseKinematics(). Your help or advice will be appreciated.