bullet3 icon indicating copy to clipboard operation
bullet3 copied to clipboard

Pepper camera subscription segmentation error: Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)

Open transxposon opened this issue 1 week ago • 1 comments

I have been trying to get the information from Pepper's camera on qibullet (tried both bottom and top cameras). My computer is a Macbook Pro with M2 chip.

the versions of libraries i am using are below

Name: pybullet Version: 3.2.6 Name: qibullet Version: 1.4.6 Name: numpy Version: 2.0.0 Name: pip Version: 24.1 Name: opencv-python Version: 4.10.0.84

the simplified version of the code I tried to run is here.


import pybullet as p
import pybullet_data
from qibullet import SimulationManager, PepperVirtual

def main():
    # Connect to the physics server
    client = p.connect(p.GUI)
    p.setAdditionalSearchPath(pybullet_data.getDataPath())
    p.setGravity(0, 0, -9.81)
    print("Connected to PyBullet.")

    # Initialize the Simulation Manager
    simulation_manager = SimulationManager()
    print("Simulation Manager initialized.")

    # Spawn Pepper robot
    pepper = simulation_manager.spawnPepper(client, translation=[0, 0, 0], quaternion=[0, 0, 0, 1])
    print("Pepper robot spawned.")

    # Subscribe to Pepper's camera
    try:
        print("Subscribing to Pepper's camera...")
        pepper_camera = pepper.subscribeCamera(PepperVirtual.ID_CAMERA_BOTTOM)
        print("Successfully subscribed to Pepper's camera.")
    except Exception as e:
        print("Error subscribing to Pepper's camera:", e)
        return

    # Check if the camera subscription is working
    try:
        print("Getting camera frame...")
        img = pepper.getCameraFrame(pepper_camera)
        if img is None:
            print("Camera frame is None")
        else:
            print("Camera frame acquired successfully")
    except Exception as e:
        print("Error getting camera frame:", e)
        return

    # Unsubscribe from the camera
    try:
        print("Unsubscribing from Pepper's camera...")
        pepper.unsubscribeCamera(pepper_camera)
        print("Unsubscribed from Pepper's camera.")
    except Exception as e:
        print("Error unsubscribing from Pepper's camera:", e)

    p.disconnect()

if __name__ == "__main__":
    main()

and what I see on the terminal after Pepper is built on OPENGL3+ window and shuts down immediately.

Version = 4.1 Metal - 83 Vendor = Apple Renderer = Apple M2 Pro b3Printf: Selected demo: Physics Server startThreads creating 1 threads. starting thread 0 started thread 0 MotionThreadFunc thread started Connected to PyBullet. Simulation Manager initialized. Pepper robot spawned. Subscribing to Pepper's camera...

Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)

I am able to extract information from Pepper's camera when I am using UTM Virtual Machine Linux, however, since I also need to use PsychoPy which is not supported properly on Unix and slows my computer considerably, I have to switch back to my Mac. Has anyone been able to solve this segmentation issue? Is it incompatibility, do I throw an M2 Mac to garbage?

Thanks!!

transxposon avatar Jun 26 '24 17:06 transxposon