Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2f140 causing segmentation fault #14

Open
richardrl opened this issue Mar 29, 2020 · 3 comments
Open

2f140 causing segmentation fault #14

richardrl opened this issue Mar 29, 2020 · 3 comments

Comments

@richardrl
Copy link
Contributor

richardrl commented Mar 29, 2020

Describe the bug
After installing in python2.7 with virtualenv on Mac OS Sierra, I get the following error on the block_stacking example script:

pybullet build time: Mar 28 2020 16:47:39
Version = 4.1 NVIDIA-10.17.5 355.10.05.45f01
Vendor = NVIDIA Corporation
Renderer = NVIDIA GeForce GT 750M OpenGL Engine
b3Printf: Selected demo: Physics Server
startThreads creating 1 threads.
starting thread 0
started thread 0 
MotionThreadFunc thread started
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: ee_link
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: base
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: tool0
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: left_inner_finger_pad
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: right_inner_finger_pad
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: No inertial data for link, using mass=1, localinertiadiagonal = 1,1,1, identity local inertial frame
b3Printf: b3Warning[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,126]:

b3Printf: ee_tip
Fatal Python error: Segmentation fault

Current thread 0x000070000201a000 (most recent call first):
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/ee_tool/robotiq2f140_pybullet.py", line 158 in get_pos
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/ee_tool/robotiq2f140_pybullet.py", line 214 in _set_rest_joints
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/ee_tool/robotiq2f140_pybullet.py", line 207 in _th_mimic_gripper
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763 in run
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810 in __bootstrap_inner
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 783 in __bootstrap

Thread 0x00007fffb8ec43c0 (most recent call first):
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/utils/common.py", line 353 in list_class_names
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/sensor/camera/__init__.py", line 6 in <module>
  File "/Users/richard/improbable/airobot_labversion2/src/airobot/__init__.py", line 136 in __init__
  File "block_stacking.py", line 15 in main
  File "block_stacking.py", line 58 in <module>
Segmentation fault: 11

It only errors on "ur5e_2f140" not "ur5e_stick". The end effector is causing problems.

Additionally, when I break into the line right before the error:

File "/Users/richard/improbable/airobot_labversion2/src/airobot/ee_tool/robotiq2f140_pybullet.py", line 158 in get_pos

I can call getJointInfo successfully on the same self.robot_id and jnt_id for which getJointState fails:

self._pb.getJointInfo(self.robot_id, jnt_id)
(Pdb) (12, 'finger_joint', 0, 13, 12, 1, 0.0, 0.0, 0.0, 0.7, 1000.0, 2.0, 'left_outer_knuckle', (-1.0, 0.0, 0.0), (-8.625e-08, -0.030596341699999998, 0.023455000000000004), (0.9119033508710461, 0.0, 0.0, -0.4104050178423233), 11)

So the joint exists, is loaded from the URDF, yet we can't read the state...

Expected behavior
The script should complete the block stacking behavior in pybullet.

Desktop (please complete the following information):
Mac OSX 10.12 Sierra

@richardrl
Copy link
Contributor Author

I bypassed this issue by commenting out lines 78-80 here:

self._th_gripper = threading.Thread(target=self._th_mimic_gripper)

But of course, this means only one finger is actuated. Maybe there is a way to do the mimicing without a new thread?

@taochenshh
Copy link
Collaborator

There are some discussions on how to model mimic joints in pybullet here. It's possible to model it using addConstraint. I tried a little bit but didn't make it work. Maybe you can have another try, and pull requests are always welcomed.

Do u have any intuition on why creating a thread will cause seg fault on Mac? Maybe we can switich to use a multiprocessing module instead?

@chao0716
Copy link

I didn`t find this problem in windows. Does it fixed or just I am lucky?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants