Skip to content

Fix pybullet NumPy API pointer types and camera buffer sizes - #4800

Open
Fstarnb wants to merge 1 commit into
bulletphysics:masterfrom
Fstarnb:fix/pybullet-numpy-simple-new-cast
Open

Fix pybullet NumPy API pointer types and camera buffer sizes#4800
Fstarnb wants to merge 1 commit into
bulletphysics:masterfrom
Fstarnb:fix/pybullet-numpy-simple-new-cast

Conversation

@Fstarnb

@Fstarnb Fstarnb commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Building pybullet.c with stricter C compilers fails with incompatible pointer type errors around PyArray_SimpleNew (reported on Raspberry Pi and similar toolchains).

Cast the dimension arrays to const npy_intp * at both camera-image call sites. Also correct the obsolete camera image path so depth/segmentation memcpy uses element sizes (sizeof(float) / sizeof(int)), matching the primary path.

Test plan

  • Diff review of both PyArray_SimpleNew sites
  • Compile pybullet with NumPy enabled on a strict GCC toolchain (e.g. Raspberry Pi / modern GCC)

Fixes #4796.

Cast dimension arrays when calling PyArray_SimpleNew so stricter C
compilers accept the NumPy C API. Also use element sizes for depth and
segmentation memcpy in the obsolete camera image path.

Fixes bulletphysics#4796.
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

Successfully merging this pull request may close these issues.

pybullet.c won't compile incompatible pointer types

1 participant